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.
 
 
 
 
 
 

37 lines
1.1 KiB

import { ElOption, ElSelect } from 'element-plus'
import { createEditorTableProp } from '@/visual-editor/visual-editor.props'
import { VisualEditorComponent } from '@/visual-editor/visual-editor.utils'
export default {
key: 'select',
moduleName: 'baseWidgets',
label: '下拉框',
preview: () => <ElSelect />,
render: ({ props, model, custom }) => (
<ElSelect
{...custom}
key={(props.options || []).map((opt: any) => opt.value).join(',')}
{...model.default}
>
{(props.options || []).map((opt: { label: string; value: string }, index: number) => (
<ElOption label={opt.label} value={opt.value} key={index} />
))}
</ElSelect>
),
props: {
options: createEditorTableProp({
label: '下拉选项',
option: {
options: [
{ label: '显示值', field: 'label' },
{ label: '绑定值', field: 'value' },
{ label: '备注', field: 'comments' }
],
showKey: 'label'
}
})
},
model: {
default: '绑定字段'
}
} as VisualEditorComponent