@form-create/vant
Version:
Vant 版本(移动端)低代码表单 | FormCreate 是一个可以通过 JSON 生成具有动态渲染、数据收集、验证和提交功能的低代码表单生成组件。
60 lines (51 loc) • 1.17 kB
JavaScript
import hidden from './hidden';
import row from './row';
import {hasProperty} from '@form-create/utils/lib/type';
const checkbox = {
name: 'checkbox',
mergeProp(ctx) {
const props = ctx.prop.props;
if (!hasProperty(props, 'options'))
props.options = ctx.prop.options || [];
}
}
const radio = {
name: 'radio',
mergeProp(ctx) {
const props = ctx.prop.props;
if (!hasProperty(props, 'options'))
props.options = ctx.prop.options || [];
}
}
const select = {
name: 'select',
mergeProp(ctx) {
const props = ctx.prop.props;
if (!hasProperty(props, 'options'))
props.options = ctx.prop.options || [];
}
}
const cascader = {
name: 'cascader',
mergeProp(ctx) {
const props = ctx.prop.props;
if (!hasProperty(props, 'options'))
props.options = ctx.prop.options || [];
}
}
const textarea = {
name: 'textarea',
mergeProp(ctx) {
let {props} = ctx.prop;
props.type = 'textarea';
}
}
export default [
hidden,
row,
cascader,
checkbox,
radio,
select,
textarea,
]