Closed yin2017168 closed 1 month ago
<script setup lang="ts">
import { AiEditor } from 'aieditor'
import 'aieditor/dist/style.css'
import type { CSSProperties } from 'vue'
import { onMounted, onUnmounted, ref } from 'vue'
const doing = ref(false)
const divRef = ref()
let aiEditor: AiEditor | null = null
function change() {
if (doing.value) {
return
}
// do something
}
onMounted(() => {
aiEditor = new AiEditor({
element: divRef.value as Element,
placeholder: "点击输入内容...",
content: 'AiEditor 是一个面向 AI 的开源富文本编辑器。 ',
onChange: () => {
change()
},
})
})
onUnmounted(() => {
aiEditor && aiEditor.destroy();
})
function onCompositionEnd() {
doing.value = false
change()
}
</script>
<template>
<div ref="divRef" @compositionstart="doing = true" @compositionend="onCompositionEnd" />
</template>
最新版本测试无法复现。
详情可见附件视频
https://github.com/aieditor-team/AiEditor/assets/26922373/65b736e0-df7b-439b-8b50-196e37de56fb
麻烦看一下怎么解决,谢谢