form-tdesigner
Version:
好用的Vue低代码可视化表单设计器,可以通过拖拽的方式快速创建表单,提高开发者对表单的开发效率。
61 lines (57 loc) • 1.35 kB
JavaScript
import uniqueId from '@form-create/utils/lib/unique';
import { localeProps, localeOptions } from '../../utils';
const label = '滑块';
const name = 'slider';
export default {
menu: 'main',
icon: 'icon-slider',
label,
name,
event: ['change', 'input'],
validate: ['number', 'array'],
rule({ t }) {
return {
type: name,
field: uniqueId(),
title: t('com.slider.name'),
info: '',
$required: false,
value: 0,
props: {},
};
},
props(_, { t }) {
return localeProps(t, name + '.props', [
{ type: 'switch', field: 'disabled' },
{
type: 'switch',
field: 'range',
},
{
type: 'inputNumber',
field: 'min',
props: { min: 0 },
},
{
type: 'inputNumber',
field: 'max',
props: { min: 0 },
},
{
type: 'inputNumber',
field: 'step',
props: { min: 0 },
},
{ type: 'switch', field: 'inputNumberProps' },
{ type: 'switch', field: 'showStep' },
{
type: 'select',
field: 'layout',
options: localeOptions(t, [
{ label: 'vertical', value: 'vertical' },
{ label: 'horizontal', value: 'horizontal' },
]),
},
]);
},
};