form-tdesigner
Version:
好用的Vue低代码可视化表单设计器,可以通过拖拽的方式快速创建表单,提高开发者对表单的开发效率。
65 lines (62 loc) • 1.42 kB
JavaScript
import uniqueId from '@form-create/utils/lib/unique';
import { localeOptions, localeProps } from '../../utils';
const label = '日期';
const name = 'datePicker';
export default {
menu: 'main',
icon: 'icon-date',
label,
name,
event: [
'change',
'blur',
'focus',
'calendarChange',
'panelChange',
'visibleChange',
],
rule({ t }) {
return {
type: name,
field: uniqueId(),
title: t('com.datePicker.name'),
info: '',
$required: false,
props: {},
};
},
props(_, { t }) {
return localeProps(t, name + '.props', [
{ type: 'switch', field: 'readonly' },
{
type: 'switch',
field: 'disabled',
},
{
type: 'select',
field: 'mode',
options: localeOptions(t, [
{ label: 'date', value: 'date' },
{ label: 'week', value: 'week' },
{ label: 'quarter', value: 'quarter' },
{ label: 'year', value: 'year' },
{ label: 'month', value: 'month' },
]),
},
{
type: 'switch',
field: 'clearable',
value: true,
},
{ type: 'switch', field: 'allowInput', value: true },
{
type: 'input',
field: 'placeholder',
},
{
type: 'input',
field: 'format',
},
]);
},
};