refactor(editor): 重构编辑器组件代码块顺序
- 调整MarkDownEditor和RichTextEditor为template→script→style顺序 - 统一编辑器组件结构规范 - 提升组件代码可读性
This commit is contained in:
parent
797c42aea1
commit
a48cb3738d
@ -1,3 +1,9 @@
|
|||||||
|
<template>
|
||||||
|
<MdEditor
|
||||||
|
v-model="model" :theme="appStore.colorMode" :toolbars-exclude="toolbarsExclude"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { ToolbarNames } from 'md-editor-v3'
|
import type { ToolbarNames } from 'md-editor-v3'
|
||||||
|
|
||||||
@ -20,10 +26,4 @@ const toolbarsExclude: ToolbarNames[] = [
|
|||||||
]
|
]
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
|
||||||
<MdEditor
|
|
||||||
v-model="model" :theme="appStore.colorMode" :toolbars-exclude="toolbarsExclude"
|
|
||||||
/>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
<template>
|
||||||
|
<div ref="editorRef" />
|
||||||
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import Quill from 'quill'
|
import Quill from 'quill'
|
||||||
import { useTemplateRef } from 'vue'
|
import { useTemplateRef } from 'vue'
|
||||||
@ -101,7 +105,3 @@ watch(
|
|||||||
|
|
||||||
onBeforeUnmount(() => editorInst = null)
|
onBeforeUnmount(() => editorInst = null)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
|
||||||
<div ref="editorRef" />
|
|
||||||
</template>
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user