fix(打卡页面): 在离开页面时清除lastTaskId以强制刷新
关键修改是在路由离开时清除了lastTaskId,确保即使相同ID的任务再次进入也会触发刷新
Showing
1 changed file
with
3 additions
and
1 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2025-05-29 15:34:17 | 2 | * @Date: 2025-05-29 15:34:17 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2025-12-19 01:21:14 | 4 | + * @LastEditTime: 2025-12-19 14:55:13 |
| 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue | 5 | * @FilePath: /mlaj/src/views/checkin/IndexCheckInPage.vue |
| 6 | * @Description: 文件描述 | 6 | * @Description: 文件描述 |
| 7 | --> | 7 | --> |
| ... | @@ -673,6 +673,8 @@ onBeforeRouteLeave((to, from) => { | ... | @@ -673,6 +673,8 @@ onBeforeRouteLeave((to, from) => { |
| 673 | // 检查目标路径是否是打卡详情页 | 673 | // 检查目标路径是否是打卡详情页 |
| 674 | if (!to.path.startsWith('/checkin/detail')) { | 674 | if (!to.path.startsWith('/checkin/detail')) { |
| 675 | sessionStorage.removeItem('collapsible_calendar_filter_state') | 675 | sessionStorage.removeItem('collapsible_calendar_filter_state') |
| 676 | + // 关键:清除 lastTaskId,这样下次即使同ID进入,也会被视为新任务触发刷新 | ||
| 677 | + lastTaskId.value = '' | ||
| 676 | } | 678 | } |
| 677 | }) | 679 | }) |
| 678 | 680 | ... | ... |
-
Please register or login to post a comment