在A页面点击按钮跳转H5页面,首先要配置下面的路由,页面如下面写
WXML
<view class="page-box">
<web-view src="{{urlAll}}" ></web-view>
</view>
JS
Page({
/**
* 页面的初始数据
*/
data: {
urlAll: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let vm = this
if (options.id === 'server') {
vm.setData({
urlAll: 'https://www.baidu.com'
})
}
},
})
喜欢可以点赞收藏呦。。