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