style: 💄 代码格式调整,完善注释
Former-commit-id: fecca52be3ae2909242d8e7de65a37ceeac493e5
This commit is contained in:
@@ -20,7 +20,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onBeforeUnmount, shallowRef, reactive, toRefs } from "vue";
|
|
||||||
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
|
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
|
||||||
|
|
||||||
// API 引用
|
// API 引用
|
||||||
@@ -37,11 +36,10 @@ const emit = defineEmits(["update:modelValue"]);
|
|||||||
|
|
||||||
const defaultHtml = useVModel(props, "modelValue", emit);
|
const defaultHtml = useVModel(props, "modelValue", emit);
|
||||||
|
|
||||||
// 编辑器实例,必须用 shallowRef
|
const editorRef = shallowRef(); // 编辑器实例,必须用 shallowRef
|
||||||
const editorRef = shallowRef();
|
const mode = ref("default"); // 编辑器模式
|
||||||
|
const toolbarConfig = ref({}); // 工具条配置
|
||||||
const toolbarConfig = ref({});
|
// 编辑器配置
|
||||||
|
|
||||||
const editorConfig = ref({
|
const editorConfig = ref({
|
||||||
placeholder: "请输入内容...",
|
placeholder: "请输入内容...",
|
||||||
MENU_CONF: {
|
MENU_CONF: {
|
||||||
@@ -57,8 +55,6 @@ const editorConfig = ref({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const mode = ref("default");
|
|
||||||
|
|
||||||
const handleCreated = (editor: any) => {
|
const handleCreated = (editor: any) => {
|
||||||
editorRef.value = editor; // 记录 editor 实例,重要!
|
editorRef.value = editor; // 记录 editor 实例,重要!
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user