mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-07 09:22:27 +00:00
fix(vue-app): remove trailing slash in vue-router non-strict mode (#5746)
This commit is contained in:
parent
b0f955230a
commit
30419e73f2
@ -41,7 +41,8 @@ export default {
|
|||||||
return this.nuxtChildKey || compile(this.$route.matched[0].path)(this.$route.params)
|
return this.nuxtChildKey || compile(this.$route.matched[0].path)(this.$route.params)
|
||||||
}
|
}
|
||||||
|
|
||||||
const Component = this.$route.matched[0] && this.$route.matched[0].components.default
|
const [matchedRoute] = this.$route.matched
|
||||||
|
const Component = matchedRoute && matchedRoute.components.default
|
||||||
if (Component && Component.options) {
|
if (Component && Component.options) {
|
||||||
const { key, watchQuery } = Component.options
|
const { key, watchQuery } = Component.options
|
||||||
|
|
||||||
@ -64,7 +65,8 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.$route.path
|
const strict = /\/$/.test(matchedRoute.path)
|
||||||
|
return strict ? this.$route.path : this.$route.path.replace(/\/$/, '')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeCreate() {
|
beforeCreate() {
|
||||||
|
Loading…
Reference in New Issue
Block a user