mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
fix(vue-app): use route.replace instead of router.push to trigger navigation guards (#9201)
This commit is contained in:
parent
8e2cad5a8f
commit
330e5c99bc
@ -269,7 +269,7 @@ async function createApp(ssrContext, config = {}) {
|
||||
|
||||
// Wait for async component to be resolved first
|
||||
await new Promise((resolve, reject) => {
|
||||
router.push(app.context.route.fullPath, resolve, (err) => {
|
||||
router.replace(app.context.route.fullPath, resolve, (err) => {
|
||||
// https://github.com/vuejs/vue-router/blob/v3.4.3/src/util/errors.js
|
||||
if (!err._isRouter) return reject(err)
|
||||
if (err.type !== 2 /* NavigationFailureType.redirected */) return resolve()
|
||||
|
Loading…
Reference in New Issue
Block a user