Skip to content

Commit 4859405

Browse files
committed
Fix: 重复刷新嵌套路由后刷新无效问题
1 parent 7f3bd5e commit 4859405

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-tpl",
33
"author": "毛瑞 <[email protected]>",
4-
"version": "1.2.0",
4+
"version": "1.2.1",
55
"private": false,
66
"license": "MIT",
77
"keywords": [

src/pages/index/router.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ function refreshRoute(matched: RouteRecord[], meta: { e: any }) {
7878
}
7979
}
8080

81-
// 没实例(functional) - 刷她爸爸
82-
temp === 0 && (matched as any).parent && refreshRoute([(matched as any).parent], meta)
81+
// 没实例 - 刷她爸爸
82+
!temp && (matched as any).parent && refreshRoute([(matched as any).parent], meta)
8383
return
8484
}
8585
}

src/pages/other/router.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ function refreshRoute(matched: RouteRecord[], meta: { e: any }) {
7878
}
7979
}
8080

81-
// 没实例(functional) - 刷她爸爸
82-
temp === 0 && (matched as any).parent && refreshRoute([(matched as any).parent], meta)
81+
// 没实例 - 刷她爸爸
82+
!temp && (matched as any).parent && refreshRoute([(matched as any).parent], meta)
8383
return
8484
}
8585
}

0 commit comments

Comments
 (0)