1
0
mirror of https://github.com/sahadev/vue-component-creater-ui.git synced 2025-12-16 15:34:17 +08:00

update: 调出代码展示框

This commit is contained in:
shangbin
2021-12-06 19:03:30 +08:00
parent d592b920e9
commit 870b865df0
5 changed files with 32 additions and 35 deletions

View File

@@ -1,7 +1,7 @@
<template>
<el-dialog title="JS逻辑编辑" v-model="codeDialogVisible" width="70%" top="10vh" :before-close="handleClose"
:center=true>
<!-- <CodeEditor style="max-height: 65vh;" ref="codeEditor" :initCode="code" mode="text/javascript"></CodeEditor> -->
<CodeEditor style="max-height: 65vh;" ref="codeEditor" :initCode="code" mode="text/javascript"></CodeEditor>
<div style="text-align:center;padding: 10px;">
<el-button type="primary" @click="onSave">确认修改</el-button>
@@ -14,13 +14,13 @@
<script>
import dedent from 'dedent'
// import CodeEditor from './CodeEditor.vue'
import CodeEditor from './CodeEditor.vue'
export default {
props: ['codeDialogVisible'],
emits: ['saveJSCode'],
emits: ['saveJSCode', 'update:codeDialogVisible'],
components: {
// CodeEditor
CodeEditor
},
data() {
@@ -89,7 +89,7 @@ export default {
// 网络请求,可选
},
handleClose() {
// this.$emit("update:codeDialogVisible", false);
this.$emit("update:codeDialogVisible", false);
},
onSave() {
const code = this.$refs.codeEditor.getEditorCode();