更新
This commit is contained in:
@@ -57,6 +57,7 @@ const emit = defineEmits<{
|
||||
const editorRef = shallowRef()
|
||||
const materialPickerRef = shallowRef<InstanceType<typeof MaterialPicker>>()
|
||||
const fileType = ref('')
|
||||
const isReady = ref(false)
|
||||
|
||||
let insertFn: any
|
||||
|
||||
@@ -88,6 +89,7 @@ const valueHtml = computed({
|
||||
return props.modelValue
|
||||
},
|
||||
set(value) {
|
||||
if (!isReady.value) return
|
||||
emit('update:modelValue', value)
|
||||
}
|
||||
})
|
||||
@@ -107,6 +109,9 @@ onBeforeUnmount(() => {
|
||||
|
||||
const handleCreated = (editor: any) => {
|
||||
editorRef.value = editor // 记录 editor 实例,重要!
|
||||
nextTick(() => {
|
||||
isReady.value = true
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user