Browse Source

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

Mikasa33 4 years ago
parent
commit
9cd293c283
1 changed files with 5 additions and 1 deletions
  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 }) {