目录
1、小程序跳转H5:
<!-- 外链,webview -->
<template>
<view><web-view :src="webviewPath"></web-view></view>
</template>
<script>
export default {
data() {
return {
webviewPath: ''
};
},
onLoad() {
this.webviewPath = decodeURIComponent(this.$Route.query.webviewPath); //h5的地址
}
};
</script>
<style></style>
2、H5跳回小程序:
<script type="text/javascript">
if(window.__wxjs_environment === 'miniprogram'){
$("#zhengche").show();
}
$("#zhengche").click(function(){
wx.miniProgram.navigateTo({url:'/pages/index/index'})
});
</script>
完成。
3、延申:如果H5直接打开小程序呢?