Skip to content

Commit

Permalink
perf: 增加search.formItem公共配置,可以统一配置表单下所有字段的一些配置
Browse files Browse the repository at this point in the history
  • Loading branch information
greper committed Sep 6, 2023
1 parent 9fe52bf commit af678c5
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/fast-crud/src/components/search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,15 @@ export default defineComponent({
/**
* 列的宽度设置,span=xx
*/
col: {}
col: {},
/**
* 统一字段的formItem属性
*/
formItem: {
type: Object,
default: undefined
}
},
emits: [
/**
Expand Down Expand Up @@ -292,7 +300,9 @@ export default defineComponent({
},
getContextFn,
null,
(value) => {
(value: any) => {
const formItem = _.cloneDeep(props.formItem || {});
value = _.merge(formItem, value);
if (!props.validate) {
//如果关闭validate则去掉rules
_.forEach(value, (item) => {
Expand Down

0 comments on commit af678c5

Please sign in to comment.