pref: wangeditor
This commit is contained in:
parent
fcf73744e3
commit
20af4d6f66
|
@ -60,11 +60,12 @@ onBeforeUnmount(() => {
|
||||||
<template>
|
<template>
|
||||||
<!-- 编辑器 -->
|
<!-- 编辑器 -->
|
||||||
<div class="editor—wrapper">
|
<div class="editor—wrapper">
|
||||||
|
<!-- 这里不能用 v-if,否则加载不出来 toolBar -->
|
||||||
<Toolbar
|
<Toolbar
|
||||||
class="toolbar-container"
|
class="toolbar-container"
|
||||||
:editor="editorRef"
|
:editor="editorRef"
|
||||||
:mode="$props.isShowAdvance ? 'default' : 'simple'"
|
:mode="$props.isShowAdvance ? 'default' : 'simple'"
|
||||||
v-if="props.isShowToolbar"
|
v-show="props.isShowToolbar"
|
||||||
/>
|
/>
|
||||||
<Editor
|
<Editor
|
||||||
:style="editorHeight"
|
:style="editorHeight"
|
||||||
|
|
|
@ -1,13 +1,26 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
// 导入 Vue 异步函数
|
||||||
|
import { defineAsyncComponent } from 'vue'
|
||||||
|
|
||||||
// 导入编辑器
|
// 导入编辑器
|
||||||
import WangEditor from '@/components/WangEditor.vue'
|
import WangEditor from '@/components/WangEditor.vue'
|
||||||
|
|
||||||
// 导入帖子标签
|
// 异步导入帖子标签
|
||||||
import Tags from '@/views/edit/components/Tags.vue'
|
const Tags = defineAsyncComponent(
|
||||||
|
() => import('@/views/edit/components/Tags.vue')
|
||||||
|
)
|
||||||
|
|
||||||
// 导入回复按钮
|
// 导入回复按钮
|
||||||
import ReplyPanelBtn from './ReplyPanelBtn.vue'
|
import ReplyPanelBtn from './ReplyPanelBtn.vue'
|
||||||
|
|
||||||
|
// 导入帖子页面 store
|
||||||
|
import { useKUNGalgameTopicStore } from '@/store/modules/topic'
|
||||||
|
import { storeToRefs } from 'pinia'
|
||||||
|
|
||||||
|
// 使用帖子页面的 store
|
||||||
|
const settingsStore = useKUNGalgameTopicStore()
|
||||||
|
const { isShowAdvance } = storeToRefs(settingsStore)
|
||||||
|
|
||||||
const props = defineProps(['isReply'])
|
const props = defineProps(['isReply'])
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -19,11 +32,14 @@ const props = defineProps(['isReply'])
|
||||||
<div class="title"><h3>回复给 @ 啊这可海星(楼主)</h3></div>
|
<div class="title"><h3>回复给 @ 啊这可海星(楼主)</h3></div>
|
||||||
<!-- 回复的编辑器 -->
|
<!-- 回复的编辑器 -->
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<WangEditor :height="300" />
|
<WangEditor :height="300" :isShowToolbar="isShowAdvance" />
|
||||||
</div>
|
</div>
|
||||||
<!-- 回复的页脚 -->
|
<!-- 回复的页脚 -->
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<Tags style="margin-top: 10px; margin-bottom: 10px" />
|
<Tags
|
||||||
|
style="margin-top: 10px; margin-bottom: 10px"
|
||||||
|
v-if="isShowAdvance"
|
||||||
|
/>
|
||||||
<ReplyPanelBtn />
|
<ReplyPanelBtn />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useKUNGalgameMessageStore } from '@/store/modules/message'
|
import { useKUNGalgameMessageStore } from '@/store/modules/message'
|
||||||
|
|
||||||
|
// 导入帖子页面 store
|
||||||
|
import { useKUNGalgameTopicStore } from '@/store/modules/topic'
|
||||||
|
import { storeToRefs } from 'pinia'
|
||||||
|
|
||||||
|
// 使用帖子页面的 store
|
||||||
|
const settingsStore = useKUNGalgameTopicStore()
|
||||||
|
const { isShowAdvance } = storeToRefs(settingsStore)
|
||||||
|
|
||||||
const info = useKUNGalgameMessageStore()
|
const info = useKUNGalgameMessageStore()
|
||||||
|
|
||||||
// 点击发布帖子
|
// 点击发布帖子
|
||||||
|
@ -22,7 +30,9 @@ const handleSave = () => {
|
||||||
info.info('AlertInfo.edit.draft')
|
info.info('AlertInfo.edit.draft')
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleShowAdvance = () => {}
|
const handleShowAdvance = () => {
|
||||||
|
isShowAdvance.value = !isShowAdvance.value
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
Loading…
Reference in a new issue