close #5378
This commit is contained in:
parent
72979a782a
commit
5465ae45f7
2 changed files with 14 additions and 5 deletions
|
@ -220,7 +220,9 @@
|
|||
<Button type="default">Small</Button>
|
||||
</Button-group>
|
||||
|
||||
<br><br><br><br><br>
|
||||
<br><br>
|
||||
<Button to="/icon">Open New Window</Button>
|
||||
<br><br><br>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
|
|
@ -43,11 +43,18 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
handleClick (new_window = false) {
|
||||
const router = this.$router;
|
||||
|
||||
if (new_window) {
|
||||
window.open(this.to);
|
||||
let to = this.to;
|
||||
if (router) {
|
||||
const current = this.$route;
|
||||
const route = router.resolve(this.to, current, this.append);
|
||||
to = route ? route.href : this.to;
|
||||
}
|
||||
window.open(to);
|
||||
} else {
|
||||
const isRoute = this.$router;
|
||||
if (isRoute) {
|
||||
if (router) {
|
||||
this.replace ? this.$router.replace(this.to) : this.$router.push(this.to);
|
||||
} else {
|
||||
window.location.href = this.to;
|
||||
|
|
Loading…
Add table
Reference in a new issue