fix(1.4.0-beta1): 修复代码编辑器格式化问题

This commit is contained in:
xlsea 2025-02-25 14:25:53 +08:00
parent 960c27ab04
commit d31dd100d6

View File

@ -106,14 +106,16 @@ const theme = computed(() => {
watch(
() => nodeExpression.value,
val => {
let value = val;
() => {
if (props.lang === 'json') {
try {
value = JSON.stringify(JSON.parse(val));
const obj = JSON.parse(nodeExpression.value);
if (typeof obj === 'object') {
nodeExpression.value = JSON.stringify(obj);
}
} catch {}
}
emit('update:modelValue', value);
emit('update:modelValue', nodeExpression.value);
}
);
</script>