UNPKG

form-create-designer

Version:

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

44 lines (43 loc) 1.39 kB
export default function field({t}) { return [ { type: 'FieldInput', field: 'field', value: '', title: t('form.field'), warning: t('warning.field'), }, { type: 'LanguageInput', field: 'title', value: '', title: t('form.title'), }, { type: 'LanguageInput', field: 'info', value: '', title: t('form.info'), }, { type: 'SizeInput', field: 'formCreateWrap>labelWidth', value: '', title: t('form.labelWidth'), }, { type: 'Struct', field: '_control', name: 'control', value: [], title: t('form.control'), warning: t('form.controlDocument', {doc: '<a target="_blank" href="https://pro.form-create.com/doc/control" style="color: inherit;text-decoration: underline;">' + t('form.document') + '</a>'}), props: { defaultValue: [], validate(val) { if (!Array.isArray(val)) return false; if (!val.length) return true; return !val.some(({rule}) => { return !Array.isArray(rule); }); } } }, ]; }