Fix navigation back to root

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2019-11-14 12:35:45 +01:00
parent 00ec425d5a
commit 2653815dbf
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
1 changed files with 7 additions and 1 deletions

View File

@ -95,9 +95,15 @@ export default {
* so we generate a new valid route object, get the final url back
* decode it and use it as a direct string, which vue-router
* does not encode afterwards
* @returns {string}
* @returns {string|object}
*/
to() {
if (this.parentPath === '/') {
return { name: this.$route.name }
}
// else let's build the path and make sure it's
// not url encoded (more importantly if filename have slashes)
const route = Object.assign({}, this.$route, {
// always remove first slash
params: { path: this.parentPath.substr(1) },