ソースを参照

hook修改。

jiaxiaoqiang 6 ヶ月 前
コミット
9e6952daa3
1 ファイル変更5 行追加0 行削除
  1. 5 0
      src/hooks/userCrud.ts

+ 5 - 0
src/hooks/userCrud.ts

@@ -13,6 +13,8 @@ interface UseCrudConfig {
 
   afterDataList?: Function;
 
+  afterAdd?: Function;
+
   // 需要操作的数据
   row?: any;
   // done用于结束操作
@@ -75,6 +77,9 @@ export const useCrud = (config?: UseCrudConfig) => {
         Methords.dataList();
         config?.done && config?.done();
         ElMessage.success(res?.msg ?? "");
+        if (commonConfig.value?.afterAdd) {
+          commonConfig.value?.afterAdd();
+        }
       } else {
         config?.loading && config?.loading();
         ElMessage.error(res?.msg ?? "");