vue3.x + vite2.x + vant + element-plus H5移动端低代码平台 lowcode 可视化拖拽 可视化编辑器 visual editor 类似易企秀的H5制作、建站工具、可视化搭建工具
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

34 lines
873 B

/*
* @Author: 卜启缘
* @Date: 2021-05-04 05:36:58
* @LastEditTime: 2021-06-25 08:47:18
* @LastEditors: 卜启缘
* @Description:
* @FilePath: \vite-vue3-lowcode\preview\views\comp-render.tsx
*/
import { defineComponent, PropType } from 'vue'
import type { VisualEditorBlockData, VisualEditorConfig } from '@/visual-editor/visual-editor.utils'
export default defineComponent({
name: 'CompRender',
props: {
element: {
type: Object as PropType<VisualEditorBlockData>,
default: () => ({})
},
config: {
type: Object as PropType<VisualEditorConfig>,
default: () => ({})
}
},
setup(props) {
return () =>
props.config.componentMap[props.element.componentKey].render({
size: {},
props: props.element.props || {},
model: {},
block: props.element,
custom: {}
})
}
})