Browse Source

fix(CodeEditor): add readonly prop (#572)

Mikasa33 4 năm trước cách đây
mục cha
commit
9cd293c283
1 tập tin đã thay đổi với 5 bổ sung1 xóa
  1. 5 1
      src/components/CodeEditor/src/CodeEditor.vue

+ 5 - 1
src/components/CodeEditor/src/CodeEditor.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="h-full">
-    <CodeMirrorEditor :value="getValue" @change="handleValueChange" :mode="mode" />
+    <CodeMirrorEditor :value="getValue" @change="handleValueChange" :mode="mode" :readonly="readonly" />
   </div>
 </template>
 <script lang="ts">
@@ -24,6 +24,10 @@
         type: String,
         default: MODE.JSON,
       },
+      readonly: {
+        type: Boolean,
+        default: false,
+      },
     },
     emits: ['change'],
     setup(props, { emit }) {