vue中实现跳转链接(点击跳转或者判断返回请求数据跳转)
<div @click="toRescue">
标题:window.location.href跳转到外部链接测试
</div>
......
data() {
return {
url: 'http://cs.5gbaoxian.com:8008/insurance/insurePay/orderPayRequest/',
};
},
methods: {
toRescue() {
window.location.href = this.url;
},
},
如果跳转地址需要拼接
<div @click="toRescue">
window.location.href跳转到外部链接测试
</div>
......
data() {
return {
orderId:'',
url: 'http://cs.5gbaoxian.com:8008/insurance/insurePay/orderPayRequest/',
};
},
methods: {
toRescue() {
window.location.href = this.url+this.orderId;
},
},
根据返回的结果进行跳转
if(isSuccess == true){
console.log('跳转到支付页面')
this.toRescue()
}