fix: 代码编辑器光标一直在文本最前面解决

This commit is contained in:
JiangQiming 2023-03-01 14:51:57 +08:00
parent f6a41fac5f
commit 5b7979405e
1 changed files with 9 additions and 7 deletions

View File

@ -75,7 +75,7 @@ watchEffect(() => {
});
const insert = (val) => {
if (!instance) return
if (!instance) return;
const position = instance.getPosition();
instance.executeEdits(instance.getValue(), [
{
@ -88,17 +88,19 @@ const insert = (val) => {
text: val,
},
]);
}
};
watch(() => props.modelValue,
(val) => {
instance.setValue(val)
})
// watch(
// () => props.modelValue,
// (val) => {
// instance.setValue(val);
// },
// );
defineExpose({
editorFormat,
insert,
})
});
</script>
<style lang="less" scoped>