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

VCC完成脱离及验证

This commit is contained in:
shangbin
2021-04-22 15:11:31 +08:00
parent 58f104799c
commit 92065271ff
7 changed files with 33 additions and 19 deletions

26
src/App.vue Normal file
View File

@@ -0,0 +1,26 @@
<template>
<vcc :initCodeEntity="codeStructure" @updateCodeEntity="onCodeUpdate"></vcc>
</template>
<script>
// 以这样一段结构初始化VCC组件
const initCodeStr = '{"template":{"lc_id":"root","__children":[{"div":{"class":"container","style":"min-height: 100%; padding-bottom: 100px;","lc_id":"container","__text__":"Hello欢迎使用LCG请往此区域拖拽组件","__children":[{"el-button":{"lc-mark":"","type":"danger","lc_id":"COAAYXizyI","__children":[],"__text__":"危险按钮","@click":"onButtonClick","size":"small"}}]}}]}}'
export default {
components: {
vcc: () => import('./components-v2/VCC.vue')
},
data() {
return {
codeStructure: JSON.parse(initCodeStr),
}
},
mounted() {
},
methods: {
onCodeUpdate(newCodeEntity) {
// 编辑后新的代码结构
}
}
}
</script>