Commit 9cd293c283ede7391ccd36e2208ae68cbad66453

Authored by Mikasa33
Committed by GitHub
1 parent 2f8b2183

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

src/components/CodeEditor/src/CodeEditor.vue
1 <template> 1 <template>
2 <div class="h-full"> 2 <div class="h-full">
3 - <CodeMirrorEditor :value="getValue" @change="handleValueChange" :mode="mode" /> 3 + <CodeMirrorEditor :value="getValue" @change="handleValueChange" :mode="mode" :readonly="readonly" />
4 </div> 4 </div>
5 </template> 5 </template>
6 <script lang="ts"> 6 <script lang="ts">
@@ -24,6 +24,10 @@ @@ -24,6 +24,10 @@
24 type: String, 24 type: String,
25 default: MODE.JSON, 25 default: MODE.JSON,
26 }, 26 },
  27 + readonly: {
  28 + type: Boolean,
  29 + default: false,
  30 + },
27 }, 31 },
28 emits: ['change'], 32 emits: ['change'],
29 setup(props, { emit }) { 33 setup(props, { emit }) {