Skip to content

Commit

Permalink
Support hashes in router links
Browse files Browse the repository at this point in the history
Fixes #2941
  • Loading branch information
Nico Hoffmann committed Nov 22, 2020
1 parent 5d9c918 commit 40616d6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions panel/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ import store from "./store/store.js";
Vue.use(Api, store);

Vue.prototype.$go = (path) => {

// support links with hash
path = path.split("#");
path = {
path: path[0],
hash: path[1] || null
};

router.push(path).catch(e => {
if (e && e.name && e.name === "NavigationDuplicated") {
return true;
Expand Down

0 comments on commit 40616d6

Please sign in to comment.