1
0
mirror of https://github.com/sahadev/vue-component-creater-ui.git synced 2025-09-28 07:13:21 +08:00

集成逻辑编辑器

This commit is contained in:
shangbin
2021-09-09 19:07:29 +08:00
parent e07dc3542b
commit 10d53105fc
4 changed files with 85 additions and 15 deletions

View File

@@ -138,6 +138,10 @@ export default {
onCmFocus(codemirror) {
},
onCmBlur(codemirror) {
},
getEditorCode(){
return this.code;
}
}
}
@@ -146,7 +150,6 @@ export default {
<style lang="scss" scoped>
.codemirror,
.pre {
width: 50%;
height: 100%;
margin: 0;
overflow: auto;

View File

@@ -0,0 +1,61 @@
<template>
<el-dialog title="JS逻辑编辑" :visible.sync="codeDialogVisible" width="70%" top="10vh" :before-close="handleClose"
:center=true>
<CodeEditor ref="codeEditor"></CodeEditor>
<div style="text-align:center;padding: 10px;">
<el-button type="primary" @click="onSave">确认修改</el-button>
<div style="color: #f5222d; font-size:12px; margin-top:5px;">Tips: 确认修改之后将会影响最终生成的代码逻辑</div>
</div>
</el-dialog>
</template>
<script>
import CodeEditor from './CodeEditor.vue'
export default {
props: ['codeDialogVisible'],
components: {
CodeEditor
},
data() {
return {
};
},
beforeCreate() { },
created() { },
beforeMount() { },
mounted() { },
beforeUpdate() { },
updated() { },
destoryed() { },
methods: {
// 在此自动生成
request() {
// 网络请求,可选
},
handleClose() {
this.$emit("update:codeDialogVisible", false);
},
onSave() {
const code = this.$refs.codeEditor.getEditorCode();
debugger
}
},
watch: {
},
computed: {
},
fillter: {},
};
</script>
<style scoped>
/* 在此自动生成 */
::v-deep .el-dialog__body {
padding: 0 30px !important;
}
</style>