UNPKG

arco-crud-plus

Version:

基于arco-design-vue的配置化表格表单组件

15 lines (14 loc) 1.34 kB
import { deepCopy as r } from "./validate.js"; const n = (e, l) => { const o = {}; if ((l.type === "input" || l.type === void 0) && (o.allowClear = !0, o.placeholder = `请输入${l.label}`), l.type === "input-password") { const p = r(l); return delete p.type, { ...o, ...p, msg: null }; } return l.type === "input-number" && (o.placeholder = `请输入${l.label}`), l.type === "textarea" && (o.allowClear = !0, o.showWordLimit = l.showWordLimit ?? !0, o.placeholder = `请输入${l.label}`), l.type === "select" && (o.allowClear = !0, o.placeholder = `请选择${l.label}`, o.options = [], o.options = e[l.field] || l.dicData), l.type === "cascader" && (o.allowClear = !0, o.placeholder = `请选择${l.label}`, o.options = e[l.field] || l.dicData), l.type === "radio" && (o.options = e[l.field] || l.dicData), l.type === "radio-group" && (o.options = e[l.field] || l.dicData), l.type === "checkbox-group" && (o.options = e[l.field] || l.dicData), l.type === "checkbox" && (o.options = e[l.field] || l.dicData), l.type === "date-picker" && (o.placeholder = "请选择日期"), l.type === "time-picker" && (o.allowClear = !0, o.placeholder = "请选择时间"), { ...o, ...l, msg: null, field: null, type: null, onChange: (...p) => { l.onChange && l.onChange(...p); } }; }; export { n as getComponentBindProps };