uniapp 嵌套 h5项目(webView实现)亲测有效

场景:主项目为uniapp实现的app项目 通过分包 子项目是 h5 + vue实现

uniapp端

html 页面



methods:{
 fangFa(){
   // webUni 是在离线的webView中改的 文件自己去下载
    webUni.postMessage({
				data: {
					data: 'goList', //传过去用于判断的值
					type: 'message' // type 默认就写message 就写 也可以不写
				}
			});
    }
}

之后接收到值 通过判断就可以实现了

console.log(data.data.data.arg.data) 图片

uniapp 嵌套 h5项目(webView实现)亲测有效_第1张图片

webView.js 离线修改版

链接: https://pan.baidu.com/s/1ZOJ7ZN1ujj0qFppz7hIeiw  提取码: qf9k

uniapp 官网

web-view | uni-app官网

你可能感兴趣的:(uni-app,webView,vue.js,前端,html5,javascript)