fix Button to bug
This commit is contained in:
parent
b06100ee8d
commit
df671ae8c3
2 changed files with 2 additions and 1 deletions
|
@ -311,6 +311,7 @@
|
|||
<Divider></Divider>
|
||||
<Button to="http://baidu.com" replace>http跳转</Button>
|
||||
<Button to="https://iviewui.com" replace>https跳转</Button>
|
||||
<Button :to="{path: '/icon'}">Router 对象跳转</Button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
|
|
@ -55,7 +55,7 @@ export default {
|
|||
window.open(to);
|
||||
} else {
|
||||
if (router) {
|
||||
if (this.to.includes('//')) {
|
||||
if ((typeof this.to === 'string') && this.to.includes('//')) {
|
||||
window.location.href = this.to;
|
||||
} else {
|
||||
this.replace ? this.$router.replace(this.to, () => {}) : this.$router.push(this.to, () => {});
|
||||
|
|
Loading…
Add table
Reference in a new issue