Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/history/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,14 @@ export class History {
}

runQueue(queue, iterator, () => {
const app = this.router.app
const postEnterCbs = []
const isValid = () => this.current === route
const isValid = () => {
if (app && app._isBeingDestroyed) {
return false
}
return this.current === route
}
// wait until async components are resolved before
// extracting in-component enter guards
const enterGuards = extractEnterGuards(activated, postEnterCbs, isValid)
Expand All @@ -189,8 +195,8 @@ export class History {
}
this.pending = null
onComplete(route)
if (this.router.app) {
this.router.app.$nextTick(() => {
if (app) {
app.$nextTick(() => {
postEnterCbs.forEach(cb => {
cb()
})
Expand Down