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