pref: wangeditor

This commit is contained in:
KUN1007 2023-08-03 16:44:26 +08:00
parent 0a519d8058
commit 22ef50ec10
3 changed files with 33 additions and 6 deletions

View file

@ -60,11 +60,12 @@ onBeforeUnmount(() => {
<template>
<!-- 编辑器 -->
<div class="editor—wrapper">
<!-- 这里不能用 v-if否则加载不出来 toolBar -->
<Toolbar
class="toolbar-container"
:editor="editorRef"
:mode="$props.isShowAdvance ? 'default' : 'simple'"
v-if="props.isShowToolbar"
v-show="props.isShowToolbar"
/>
<Editor
:style="editorHeight"

View file

@ -1,13 +1,26 @@
<script setup lang="ts">
// Vue
import { defineAsyncComponent } from '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'
// store
import { useKUNGalgameTopicStore } from '@/store/modules/topic'
import { storeToRefs } from 'pinia'
// 使 store
const settingsStore = useKUNGalgameTopicStore()
const { isShowAdvance } = storeToRefs(settingsStore)
const props = defineProps(['isReply'])
</script>
@ -19,11 +32,14 @@ const props = defineProps(['isReply'])
<div class="title"><h3>回复给 @ 啊这可海星楼主</h3></div>
<!-- 回复的编辑器 -->
<div class="content">
<WangEditor :height="300" />
<WangEditor :height="300" :isShowToolbar="isShowAdvance" />
</div>
<!-- 回复的页脚 -->
<div class="footer">
<Tags style="margin-top: 10px; margin-bottom: 10px" />
<Tags
style="margin-top: 10px; margin-bottom: 10px"
v-if="isShowAdvance"
/>
<ReplyPanelBtn />
</div>
</div>

View file

@ -1,6 +1,14 @@
<script setup lang="ts">
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()
//
@ -22,7 +30,9 @@ const handleSave = () => {
info.info('AlertInfo.edit.draft')
}
const handleShowAdvance = () => {}
const handleShowAdvance = () => {
isShowAdvance.value = !isShowAdvance.value
}
</script>
<template>