fix Button open link when use to and target _blank
This commit is contained in:
parent
67beea14d6
commit
9d6b5f0381
1 changed files with 12 additions and 7 deletions
|
@ -42,10 +42,8 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
handleClick (new_window = false) {
|
||||
handleOpenTo () {
|
||||
const router = this.$router;
|
||||
|
||||
if (new_window) {
|
||||
let to = this.to;
|
||||
if (router) {
|
||||
const current = this.$route;
|
||||
|
@ -53,6 +51,12 @@ export default {
|
|||
to = route ? route.href : this.to;
|
||||
}
|
||||
window.open(to);
|
||||
},
|
||||
handleClick (new_window = false) {
|
||||
const router = this.$router;
|
||||
|
||||
if (new_window) {
|
||||
this.handleOpenTo();
|
||||
} else {
|
||||
if (router) {
|
||||
if ((typeof this.to === 'string') && this.to.includes('//')) {
|
||||
|
@ -68,6 +72,7 @@ export default {
|
|||
handleCheckClick (event, new_window = false) {
|
||||
if (this.to) {
|
||||
if (this.target === '_blank') {
|
||||
this.handleOpenTo();
|
||||
return false;
|
||||
} else {
|
||||
event.preventDefault();
|
||||
|
|
Loading…
Add table
Reference in a new issue