vue如何跳转支付宝付款页面
一、将后端返回的html结构,通过路由方式传递到orderAlipay页
let routerData = this.$router.resolve({path:'/orderAlipay',query: {htmlData: data}})// 打开新页面window.open(routerData.href, '_ blank')
二、orderAlipay页已html格式放入div内,直接进行提交即可跳转到支付宝的支付页
<template><div><div v-html = "payGateWay">{{payGateWay}}</div></div></template><script>export default {name: 'orderAlipay',data(){return {payGateWay: ''}} ,mounted () {this.payGateWay = this.$route.query.htmlDatathis.$nextTick(()=> {document.forms[0].submit()})}}</script><style lang="scss" scoped></style>