@zion-form-create/designer
Version:
好用的Vue低代码可视化表单设计器,可以通过拖拽的方式快速创建表单,提高开发者对表单的开发效率。
78 lines (75 loc) • 2.03 kB
JavaScript
import uniqueId from '@form-create/utils/lib/unique';
import {localeProps} from '../../utils';
const label = '多行输入框';
const name = 'textarea';
export default {
menu: 'main',
icon: 'icon-textarea',
label,
name,
input: true,
event: ['blur', 'focus', 'change', 'input'],
validate: ['string'],
rule({t}) {
return {
type: 'input',
field: uniqueId(),
title: t('com.textarea.name'),
info: '',
$required: false,
props: {
type: 'textarea'
}
};
},
props(_, {t}) {
return localeProps(t, name + '.props', [
{
type: 'switch',
field: 'disabled'
},
{
type: 'switch',
field: 'readonly'
},
{
type: 'inputNumber',
field: 'maxlength',
props: {min: 0}
},
{
type: 'switch',
field: 'showWordLimit'
},
{
type: 'input',
field: 'placeholder'
},
{
type: 'inputNumber',
field: 'rows',
props: {
min: 0
}
},
{
type: 'switch',
field: 'autosize'
},
{
type: 'switch',
field: 'ignore',
value: false,
title: '忽略',
warning: '忽略的字段数据将不会被提交',
},
{
type: 'Input',
field: 'displayCode',
value: '',
title: '显隐权限码',
warning: '设置时将检测登录用户是否被授权此权限码',
},
]);
}
};