fix: 代码编辑器光标一直在文本最前面解决
This commit is contained in:
parent
f6a41fac5f
commit
5b7979405e
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue