use link.js for anchor

This commit is contained in:
zhigang.li 2018-06-29 18:10:14 +08:00
parent 2525733729
commit 576329cc63
3 changed files with 15 additions and 17 deletions

View file

@ -26,14 +26,15 @@ export default {
methods: {
handleClick () {
const isRoute = this.$router;
let href = this.to || this.href;
if (isRoute) {
this.replace ? this.$router.replace(this.to) : this.$router.push(this.to);
this.replace ? this.$router.replace(href) : this.$router.push(href);
} else {
window.location.href = this.to;
window.location.href = href;
}
},
handleCheckClick (event) {
if (this.to) {
if (this.to || this.href) {
if (this.target === '_blank') {
return false;
} else {
@ -43,4 +44,4 @@ export default {
}
}
}
};
};