fixed bug of the components with link in vue-router 3.1+
This commit is contained in:
parent
0e6d05c3c5
commit
9c75e0223b
4 changed files with 7 additions and 3 deletions
|
@ -1,5 +1,9 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
|
<Divider>vue-router 3.1 bug</Divider>
|
||||||
|
<Button to="/button">跳转到 Button(当前路径)</Button>
|
||||||
|
<Button to="/button" replace>跳转到 Button(当前路径, replace)</Button>
|
||||||
|
<Divider></Divider>
|
||||||
<Button icon="logo-github" size="small" shape="circle"></Button>
|
<Button icon="logo-github" size="small" shape="circle"></Button>
|
||||||
<Button icon="logo-github" shape="circle"></Button>
|
<Button icon="logo-github" shape="circle"></Button>
|
||||||
<Button icon="logo-github" size="large" shape="circle"></Button>
|
<Button icon="logo-github" size="large" shape="circle"></Button>
|
||||||
|
|
|
@ -113,7 +113,7 @@
|
||||||
"vue-hot-reload-api": "^2.3.1",
|
"vue-hot-reload-api": "^2.3.1",
|
||||||
"vue-html-loader": "^1.2.4",
|
"vue-html-loader": "^1.2.4",
|
||||||
"vue-loader": "^14.2.1",
|
"vue-loader": "^14.2.1",
|
||||||
"vue-router": "^3.0.2",
|
"vue-router": "^3.1.3",
|
||||||
"vue-style-loader": "^4.1.2",
|
"vue-style-loader": "^4.1.2",
|
||||||
"vue-template-compiler": "^2.6.10",
|
"vue-template-compiler": "^2.6.10",
|
||||||
"webpack": "^3.11.0",
|
"webpack": "^3.11.0",
|
||||||
|
|
|
@ -44,7 +44,7 @@ export default {
|
||||||
this.anchorCom.$emit('on-select', this.href);
|
this.anchorCom.$emit('on-select', this.href);
|
||||||
const isRoute = this.$router;
|
const isRoute = this.$router;
|
||||||
if (isRoute) {
|
if (isRoute) {
|
||||||
this.$router.push(this.href);
|
this.$router.push(this.href, () => {});
|
||||||
} else {
|
} else {
|
||||||
window.location.href = this.href;
|
window.location.href = this.href;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ export default {
|
||||||
window.open(to);
|
window.open(to);
|
||||||
} else {
|
} else {
|
||||||
if (router) {
|
if (router) {
|
||||||
this.replace ? this.$router.replace(this.to) : this.$router.push(this.to);
|
this.replace ? this.$router.replace(this.to, () => {}) : this.$router.push(this.to, () => {});
|
||||||
} else {
|
} else {
|
||||||
window.location.href = this.to;
|
window.location.href = this.to;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue