@zion-form-create/designer
Version:
好用的Vue低代码可视化表单设计器,可以通过拖拽的方式快速创建表单,提高开发者对表单的开发效率。
57 lines (54 loc) • 1.75 kB
JavaScript
import uniqueId from '@form-create/utils/lib/unique';
import {localeProps, makeOptionsRule, makeTreeOptions} from '../../utils/index';
const label = '单选框';
const name = 'radio';
export default {
menu: 'main',
icon: 'icon-radio',
label,
name,
input: true,
event: ['change'],
validate: ['string', 'number'],
rule({t}) {
return {
type: name,
field: uniqueId(),
title: t('com.radio.name'),
info: '',
effect: {
fetch: ''
},
$required: false,
props: {},
options: makeTreeOptions(t('props.option'), {label: 'label', value: 'value'}, 1)
};
},
props(_, {t}) {
return localeProps(t, name + '.props', [
makeOptionsRule(t, 'options'),
{type: 'switch', field: 'disabled'},
{type: 'switch', field: 'input'},
{
type: 'switch',
field: 'type',
props: {activeValue: 'button', inactiveValue: 'default'}
}, {type: 'ColorInput', field: 'textColor'}, {
type: 'ColorInput',
field: 'fill'
},{
type: 'switch',
field: 'ignore',
value: false,
title: '忽略',
warning: '忽略的字段数据将不会被提交',
},
{
type: 'Input',
field: 'displayCode',
value: '',
title: '显隐权限码',
warning: '设置时将检测登录用户是否被授权此权限码',
},]);
}
};