update: 代码编辑器格式化
This commit is contained in:
parent
45e2479831
commit
b82c2ecda7
|
@ -59,6 +59,20 @@ onMounted(() => {
|
||||||
emit('update:modelValue', value);
|
emit('update:modelValue', value);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代码格式化
|
||||||
|
*/
|
||||||
|
const editorFormat = () => {
|
||||||
|
if (!instance) return;
|
||||||
|
instance.getAction('editor.action.formatDocument')?.run();
|
||||||
|
};
|
||||||
|
|
||||||
|
watchEffect(() => {
|
||||||
|
setTimeout(() => {
|
||||||
|
editorFormat();
|
||||||
|
}, 300);
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|
Loading…
Reference in New Issue