在h5頁面進(jìn)行監(jiān)聽返回跳轉(zhuǎn)判斷:
created(){
this.pushHistory();
window.addEventListener("popstate", function(e) {
//首頁點(diǎn)擊返回,直接關(guān)閉網(wǎng)頁
WeixinJSBridge.call('closeWindow');
uni.reLaunch({
url: `xxxx`,
});
}, false);
},
methods:{
pushHistory() {
var state = {
title: "title",
url: "#"
};
window.history.pushState(state, state.title, state.url);
},
}
文章來源:http://www.zghlxwxcb.cn/news/detail-500516.html
小程序web-view,在h5頁面監(jiān)聽返回到小程序指定頁面進(jìn)行判斷,如果攜帶參數(shù),在小程序onLoad里面進(jìn)行接收文章來源地址http://www.zghlxwxcb.cn/news/detail-500516.html
到了這里,關(guān)于小程序web-view,h5頁監(jiān)聽返回到小程序指定頁面的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!