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

支持了以文本转换为对象,再将对象转换为文本

This commit is contained in:
shangbin 2021-09-09 19:14:48 +08:00
parent 10d53105fc
commit d4e5621743
2 changed files with 11 additions and 5 deletions

View File

@ -66,10 +66,7 @@ export default {
data() {
return {
code: dedent`
//
// axiosaxios
// axioshttps://www.npmjs.com/package/axios
export default {
{
props: [],
components: {},

View File

@ -1,11 +1,19 @@
<template>
<el-dialog title="JS逻辑编辑" :visible.sync="codeDialogVisible" width="70%" top="10vh" :before-close="handleClose"
:center=true>
<div style="font-size:12px; margin-top:5px;">
// </div>
<div style="font-size:12px; margin-top:5px;">
// axiosaxios</div>
<div style="font-size:12px; margin-top:5px;">
// axioshttps://www.npmjs.com/package/axios</div>
<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>
@ -41,7 +49,8 @@ export default {
},
onSave() {
const code = this.$refs.codeEditor.getEditorCode();
debugger
const JSCodeInfo = eval(`(function(){return ${code}})()`);
console.info(JSCodeInfo.methods.request.toString());
}
},
watch: {