fix Button bug in 4.6.0

This commit is contained in:
梁灏 2021-06-13 10:13:08 +08:00
parent 8f25ba65d2
commit 2ef37a9560
2 changed files with 4 additions and 1 deletions

View file

@ -309,9 +309,11 @@
</ButtonGroup>
</div>
<Divider></Divider>
<Button to="http://baidu.com" replace>http跳转</Button>
<Button to="http://baidu.com">http跳转</Button>
<Button to="http://baidu.com" target="_blank">http跳转(_blank)</Button>
<Button to="https://iviewui.com" replace>https跳转</Button>
<Button :to="{path: '/icon'}">Router 对象跳转</Button>
<Button :to="{path: '/icon'}" target="_blank">Router 对象跳转(_blank)</Button>
</div>
</template>
<script>

View file

@ -50,6 +50,7 @@ export default {
const route = router.resolve(this.to, current, this.append);
to = route ? route.href : this.to;
}
if (typeof this.to === 'string') return; // 会跳转两次
window.open(to);
},
handleClick (new_window = false) {