Browse Source

注释代码编辑框组件不必要逻辑

孤城浪人 7 months ago
parent
commit
1f4a035afe
1 changed files with 12 additions and 11 deletions
  1. 12 11
      src/views/components/common/CodeEditor.vue

+ 12 - 11
src/views/components/common/CodeEditor.vue

@@ -121,17 +121,18 @@ onMounted(() => {
   }, 300);
 });
 
-watch(
-  () => modelValue,
-  (newValue) => {
-    if (editor) {
-      const value = editor.getValue();
-      if (newValue !== value) {
-        editor.setValue(newValue);
-      }
-    }
-  }
-);
+// watch(
+//   () => modelValue,
+//   (newValue) => {
+//     if (editor) {
+//       const value = editor.getValue();
+//       newValue = json ? JSON.stringify(newValue) : newValue;
+//       if (newValue !== value) {
+//         editor.setValue(newValue);
+//       }
+//     }
+//   }
+// );
 
 watch(
   () => options,