UNPKG

gepic

Version:

基于vue3的设计器,可视化开发页面表单

129 lines (128 loc) 2.99 kB
const n = { component: async () => (await import("ant-design-vue")).Switch, groupName: "表单", icon: "icon--epic--toggle-off-outline", sort: 930, defaultSchema: { label: "开关", type: "switch", field: "switch", input: !0, componentProps: { defaultValue: !1 } }, config: { attribute: [ { label: "字段名", type: "input", field: "field" }, { label: "标题", type: "input", field: "label" }, { label: "默认值", type: "switch", field: "componentProps.defaultValue" }, { label: "ON状态值", type: "input", field: "componentProps.checkedValue", componentProps: { placeholder: "请输入" }, onChange(e) { setTimeout(() => t(e)); } }, { label: "OFF状态值", type: "input", field: "componentProps.unCheckedValue", componentProps: { placeholder: "请输入" }, onChange(e) { setTimeout(() => t(e)); } }, { label: "ON状态描述", type: "input", field: "componentProps.checkedChildren", componentProps: { placeholder: "请输入" } }, { label: "OFF状态描述", type: "input", field: "componentProps.unCheckedChildren", componentProps: { placeholder: "请输入" } }, { label: "尺寸", type: "select", componentProps: { placeholder: "请选择", allowClear: !0, options: [ { label: "default", value: "default" }, { label: "small", value: "small" } ] }, field: "componentProps.size" }, { label: "禁用", type: "switch", field: "componentProps.disabled" }, { label: "隐藏", type: "switch", field: "componentProps.hidden" }, { label: "表单校验", type: "ERuleEditor", layout: "vertical", field: "rules", describe: "校验规则需要配合表单使用", componentProps: { ruleType: "boolean" } } ], event: [ { type: "change", describe: "值变化时" } ] }, bindModel: "checked" }; function t(e) { var o; const l = ((o = e.values.componentProps) == null ? void 0 : o.unCheckedValue) || !1; e.values.componentProps.unCheckedValue === "" && delete e.values.componentProps.unCheckedValue, e.values.componentProps.checkedValue === "" && delete e.values.componentProps.checkedValue, e.values.componentProps ? e.values.componentProps.defaultValue = l : e.values.componentProps = { defaultValue: l }; } export { n as default };