Skip to content

Commit

Permalink
Merge pull request HalseySpicy#338 from zjb-it/master
Browse files Browse the repository at this point in the history
 enum function执行,存储结果慢,导致缓存未及时生效的bug
  • Loading branch information
HalseySpicy authored Oct 26, 2023
2 parents 608d468 + 2b94647 commit 436c1f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/ProTable/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ const setEnumMap = async ({ prop, enum: enumValue }: ColumnProps) => {
// 当前 enum 为静态数据,则直接存储到 enumMap
if (typeof enumValue !== "function") return enumMap.value.set(prop!, unref(enumValue!));

// 为了防止接口执行慢,而存储慢,导致重复请求,所以预先存储为[],接口返回后再二次存储
enumMap.value.set(prop!, []);
// 当前 enum 为后台数据需要请求数据,则调用该请求接口,并存储到 enumMap
const { data } = await enumValue();
enumMap.value.set(prop!, data);
Expand Down

0 comments on commit 436c1f6

Please sign in to comment.