1 data() { 2 return { 3 jumpUrl: null 4 } 5 }, 6 watch: { 7 // 新窗口打开页面,解决浏览器拦截问题 8 jumpUrl() { 9 if (this.jumpUrl) { 10 window.open(this.jumpUrl, '_blank') 11 } 12 this.jumpUrl = null 13 } 14 }, 15 methods: { 16 paymentApi() { 17 this.$axios 18 .post(orderCustomer.payment, { param: this.paymentData, type: '' }) 19 .then((res) => { 20 this.jumpUrl = res.data // 请求获取到url复制 21 }) 22 } 23 }