diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-11-14 14:35:45 +0300 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-11-14 14:35:45 +0300 |
commit | 2653815dbf99f18128de6325ba79eecaecaff46a (patch) | |
tree | 9e230fcffe5c798b790a6964916dff910082b5ab | |
parent | 00ec425d5a0cc897b62d9bbaccc0baaf8f646cea (diff) |
Fix navigation back to root
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
-rw-r--r-- | src/components/Navigation.vue | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/components/Navigation.vue b/src/components/Navigation.vue index e7f9f9a0..977ef61c 100644 --- a/src/components/Navigation.vue +++ b/src/components/Navigation.vue @@ -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) }, |