This commit is contained in:
神仙都没用 2023-10-12 15:06:57 +08:00
parent f5af99fa61
commit 4d0e62b850

View File

@ -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 == "<p><br></p>") {
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];