总结一下最近使用小程序的功能
前提小程序管理后台配置域名白名单, 并且 h5 页面是嵌在小程序里面
微信官方 web-view 介绍地址 https://developers.weixin.qq.com/miniprogram/dev/component/web-view.html
pages 生成一个 webview 的目录
wxml 中
<Web-view src="{{url}}"></Web-view>
JS 中接受页面传来的 url 值
- /**
- * 页面的初始数据
- */
- data: {
- url:null,
- },
- /**
- * 生命周期函数 -- 监听页面加载
- */
- onLoad: function (options) {
- this.setData({
- url: options.url
- })
- },
这样就完成了 小程序跳转 h5 页面
// 之后继续补充 h5 跳转小程序
来源: http://www.bubuko.com/infodetail-2931180.html