refactored home database materials

This commit is contained in:
2020-12-27 11:09:03 +01:00
parent 0fc6347585
commit a2773b1b20
10 changed files with 294 additions and 55 deletions

View File

@ -29,17 +29,17 @@ export default {
},
methods: {
onClickLink(e){
console.log("onClickLink", e, this.$router);
console.log("onClickLink", e, this.$router, this.$route);
let path = null;
this.$router.options.routes.forEach(route => {
// console.log('route.path', route.path);
if (route.path == e.originalTarget.pathname) {
path = e.originalTarget.pathname
// TODO: check if path is current
// TODO: as we can't break forEach is not the good method here
// find existing router route compared with link href
for (var i = 0; i < this.$router.options.routes.length; i++) {
if (this.$router.options.routes[i].path == e.originalTarget.pathname) {
if (e.originalTarget.pathname !== this.$route.path) {
path = e.originalTarget.pathname
}
break;
}
}, this)
}
if (path) {
this.$router.push({