UNPKG

@zion-form-create/designer

Version:

好用的Vue低代码可视化表单设计器,可以通过拖拽的方式快速创建表单,提高开发者对表单的开发效率。

77 lines (74 loc) 2.23 kB
import uniqueId from '@form-create/utils/lib/unique'; import {localeOptions, localeProps} from '../../utils'; const label = '输入框'; const name = 'input'; export default { menu: 'main', icon: 'icon-input', label, name, input: true, event: ['blur', 'focus', 'change', 'input', 'clear'], validate: ['string', 'url', 'email'], rule({t}) { return { type: name, field: uniqueId(), title: t('com.input.name'), info: '', $required: false, props: {} }; }, props(_, {t}) { return localeProps(t, name + '.props', [ { type: 'switch', field: 'disabled' }, { type: 'switch', field: 'readonly' }, { type: 'select', field: 'type', options: localeOptions(t, [ {label: 'text', value: 'text'}, {label: 'number', value: 'number'}, {label: 'time', value: 'time'}, {label: 'date', value: 'date'}, {label: 'month', value: 'month'}, {label: 'datetime-local', value: 'datetime-local'}, ]) }, { type: 'inputNumber', field: 'maxlength', props: {min: 0} }, { type: 'input', field: 'placeholder' }, { type: 'switch', field: 'clearable' }, { type: 'switch', field: 'ignore', value: false, title: '忽略', warning: '忽略的字段数据将不会被提交', }, { type: 'Input', field: 'displayCode', value: '', title: '显隐权限码', warning: '设置时将检测登录用户是否被授权此权限码', }, ]); } };