aboutsummaryrefslogtreecommitdiff
path: root/src/tools/html-wysiwyg-editor/editor/editor.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/html-wysiwyg-editor/editor/editor.vue')
-rw-r--r--src/tools/html-wysiwyg-editor/editor/editor.vue24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/tools/html-wysiwyg-editor/editor/editor.vue b/src/tools/html-wysiwyg-editor/editor/editor.vue
index 4c8ca36..86bdebb 100644
--- a/src/tools/html-wysiwyg-editor/editor/editor.vue
+++ b/src/tools/html-wysiwyg-editor/editor/editor.vue
@@ -1,14 +1,3 @@
-<template>
- <c-card v-if="editor" important:p0>
- <menu-bar class="editor-header" :editor="editor" />
- <n-divider style="margin-top: 0" />
-
- <div px8 pb6>
- <editor-content class="editor-content" :editor="editor" />
- </div>
- </c-card>
-</template>
-
<script setup lang="ts">
import { tryOnBeforeUnmount, useVModel } from '@vueuse/core';
import { Editor, EditorContent } from '@tiptap/vue-3';
@@ -16,9 +5,9 @@ import StarterKit from '@tiptap/starter-kit';
import { useThemeVars } from 'naive-ui';
import MenuBar from './menu-bar.vue';
-const themeVars = useThemeVars();
const props = defineProps<{ html: string }>();
const emit = defineEmits(['update:html']);
+const themeVars = useThemeVars();
const html = useVModel(props, 'html', emit);
const editor = new Editor({
@@ -33,6 +22,17 @@ tryOnBeforeUnmount(() => {
});
</script>
+<template>
+ <c-card v-if="editor" important:p0>
+ <MenuBar class="editor-header" :editor="editor" />
+ <n-divider style="margin-top: 0" />
+
+ <div px8 pb6>
+ <EditorContent class="editor-content" :editor="editor" />
+ </div>
+ </c-card>
+</template>
+
<style scoped lang="less">
::v-deep(.ProseMirror-focused) {
outline: none;