Skip to content

Commit 6fa713c

Browse files
authored
这个isSame有问题
route1.query={} route2.query={a:1} route1的query,params为空时,还是会返回true
1 parent e6ac827 commit 6fa713c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

web/src/view/layout/aside/historyComponent/history.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ const isSame = (route1, route2) => {
177177
if (route1.name !== route2.name) {
178178
return false
179179
}
180+
if (Object.keys(route1.query).length != Object.keys(route2.query).length || Object.keys(route1.params).length != Object.keys(route2.params).length) {
181+
return false
182+
}
180183
for (const key in route1.query) {
181184
if (route1.query[key] !== route2.query[key]) {
182185
return false

0 commit comments

Comments
 (0)