Kaynağa Gözat

feat(command): cat command format

Lind 4 yıl önce
ebeveyn
işleme
21bb0bb7af
1 değiştirilmiş dosya ile 5 ekleme ve 7 silme
  1. 5 7
      src/pages/device/Command/cat/index.tsx

+ 5 - 7
src/pages/device/Command/cat/index.tsx

@@ -17,13 +17,11 @@ const Cat = (props: Props) => {
         height={300}
         language={'json'}
         editorDidMount={(editor) => {
-          editor.onDidScrollChange?.(() => {
-            editor
-              .getAction('editor.action.formatDocument')
-              .run()
-              .finally(() => {
-                editor.updateOptions({ readOnly: true });
-              });
+          editor.onDidContentSizeChange?.(() => {
+            editor.getAction('editor.action.formatDocument').run();
+            // .finally(() => {
+            //   editor.updateOptions({ readOnly: true });
+            // });
           });
         }}
         value={JSON.stringify(data?.downstream)}