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