create vue-link-formatter module, integrated home link fields into vuejs

This commit is contained in:
2020-12-26 22:33:25 +01:00
parent c60d9c7316
commit 0fc6347585
11 changed files with 644 additions and 34 deletions

View File

@ -26,6 +26,27 @@ export default {
}else{
return this.template.render.call(this)
}
},
methods: {
onClickLink(e){
console.log("onClickLink", e, this.$router);
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
}
}, this)
if (path) {
this.$router.push({
path: path
})
}
}
}
}