form-tdesigner
Version:
好用的Vue低代码可视化表单设计器,可以通过拖拽的方式快速创建表单,提高开发者对表单的开发效率。
66 lines (61 loc) • 1.44 kB
JavaScript
import uniqueId from '@form-create/utils/lib/unique';
import { localeOptions, localeProps } from '../../utils';
const label = '日期区间';
const name = 't-date-range-picker';
export default {
menu: 'main',
icon: 'icon-date-range',
label,
name,
event: [
'change',
'blur',
'focus',
'confirm',
'input',
'pick',
'preset-click',
],
rule({ t }) {
return {
type: name,
field: uniqueId(),
title: '日期区间',
info: '',
$required: false,
value: [new Date()],
props: {},
};
},
props(_, { t }) {
return localeProps(t, 'dateRangePicker.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: 'format',
},
{ type: 'input', field: 'separator' },
]);
},
};