feat(PageModal): watch函数增加配置项参数返回

This commit is contained in:
cshaptx4869
2024-05-23 20:47:58 +08:00
parent a492146a16
commit 45ca474571
2 changed files with 3 additions and 3 deletions

View File

@@ -118,7 +118,7 @@ for (const item of formItems) {
watch(
() => formData[item.prop],
(newValue, oldValue) => {
item.watch && item.watch(newValue, oldValue, formData);
item.watch && item.watch(newValue, oldValue, formData, formItems);
}
);
});

View File

@@ -54,11 +54,11 @@ export type IFormItems<T = any> = Array<{
// 是否隐藏
hidden?: boolean;
// 监听函数
watch?: (newValue: any, oldValue: any, data: T) => void;
watch?: (newValue: any, oldValue: any, data: T, items: IObject[]) => void;
// 计算属性函数
computed?: (data: T) => any;
// 监听收集函数
watchEffect?: (data: T) => void;
// 初始化数据函数扩展
initFn?: (formItem: IObject) => void;
initFn?: (item: IObject) => void;
}>;