Skip to content

Commit

Permalink
refactor(guards): use enteringRecords in queue (#1910)
Browse files Browse the repository at this point in the history
  • Loading branch information
lightnoway authored Jul 3, 2023
1 parent 87e03c5 commit c5b1ea1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/router/src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -855,9 +855,9 @@ export function createRouter(options: RouterOptions): Router {
.then(() => {
// check the route beforeEnter
guards = []
for (const record of to.matched) {
for (const record of enteringRecords) {
// do not trigger beforeEnter on reused views
if (record.beforeEnter && !from.matched.includes(record)) {
if (record.beforeEnter) {
if (isArray(record.beforeEnter)) {
for (const beforeEnter of record.beforeEnter)
guards.push(guardToPromiseFn(beforeEnter, to, from))
Expand Down

0 comments on commit c5b1ea1

Please sign in to comment.