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

This commit is contained in:
Mikasa33 2021-05-07 21:00:40 +08:00 committed by GitHub
parent 2f8b2183ec
commit 9cd293c283
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 }) {