form-tdesigner
Version:
好用的Vue低代码可视化表单设计器,可以通过拖拽的方式快速创建表单,提高开发者对表单的开发效率。
78 lines (74 loc) • 1.75 kB
JavaScript
import uniqueId from "@form-create/utils/lib/unique";
import { localeOptions, localeProps } from "../../utils";
const label = "输入框";
const name = "t-input-number";
export default {
menu: "main",
icon: "icon-input",
label,
name,
event: ["blur", "focus", "change", "input", "clear"],
validate: ["string", "url", "email"],
rule({ t }) {
return {
type: name,
field: uniqueId(),
title: t("com.input.name"),
info: "",
$required: false,
props: {
autoWidth: true,
},
};
},
props(_, { t }) {
return localeProps(t, name + ".props", [
{
type: "switch",
field: "disabled",
},
{
type: "switch",
field: "readonly",
},
{
type: "select",
field: "theme",
options: localeOptions(t, [
{ label: "normal", value: "normal" },
{ label: "column", value: "column" },
{ label: "row", value: "row" },
]),
},{
type: "select",
field: "size",
options: localeOptions(t, [
{ label: "small", value: "small" },
{ label: "medium", value: "medium" },
{ label: "large", value: "large" },
]),
},
{
field: "min",
type: "inputNumber",
},
{
field: "max",
type: "inputNumber",
},
{
type: "input",
field: "placeholder",
},
{
type: "input",
field: "suffix",
},
{
type: "inputNumber",
field: "decimalPlaces",
},
{ type: "inputNumber", field: "step", props: { min: 0 } },
]);
},
};