From 4d0e62b850f4519095844d21204e774faa9ddf0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=9E=E4=BB=99=E9=83=BD=E6=B2=A1=E7=94=A8?= <615206459@qq.com> Date: Thu, 12 Oct 2023 15:06:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/extend/editor/wang.vue | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/modules/extend/editor/wang.vue b/src/modules/extend/editor/wang.vue index 043174e..9aff43b 100644 --- a/src/modules/extend/editor/wang.vue +++ b/src/modules/extend/editor/wang.vue @@ -106,20 +106,24 @@ export default defineComponent({ } }; + // 创建后 function onCreated(editor: any) { Editor.value = editor; onDisabled(); onHeight(); } + // 聚焦 function onFocus(editor: any) { emit("focus", editor); } + // 失焦 function onBlur(editor: any) { emit("blur", editor); } + // 值改变 function onChange() { if (value.value == "


") { value.value = ""; @@ -129,6 +133,7 @@ export default defineComponent({ emit("change", value.value); } + // 文件选择 function onFileConfirm(files: any[]) { if (files.length > 0) { files.forEach((file) => { @@ -139,6 +144,13 @@ export default defineComponent({ } } + // 设置高度 + function onHeight() { + const { style } = refs.editor.querySelector(".w-e-text-container"); + style.maxHeight = parsePx(props.maxHeight || "auto"); + style.height = parsePx(props.height); + } + // 禁用 function onDisabled() { if (props.disabled) { @@ -150,13 +162,6 @@ export default defineComponent({ watch(() => props.disabled, onDisabled); - // 设置高度 - function onHeight() { - const scroll = refs.editor.querySelector(".w-e-text-container"); - scroll.style.maxHeight = parsePx(props.maxHeight || "auto"); - scroll.style.height = parsePx(props.height); - } - watch( () => { return [props.height, props.maxHeight];