增加bus, 测试修改原生按钮

This commit is contained in:
mengxiaolong
2021-03-03 10:37:58 +08:00
parent 1dd20275bb
commit fcfa634a3e
10 changed files with 154 additions and 65 deletions

View File

@@ -8,9 +8,7 @@
</van-tabs>
</van-sticky>
<div class="container">
<keep-alive>
<component :is="is" />
</keep-alive>
<component :is="is" />
</div>
</div>
</template>
@@ -42,6 +40,24 @@ export default {
return 'Committed'
}
}
},
mounted() {
setTimeout(() => {
// eslint-disable-next-line no-undef
window.EWebBridge.webCallAppInJs('webview_left_button', {
intercept: '1' //是否拦截原生返回事件 1是 其他否
})
}, 100)
window.appCallBack = this.appCallBack
},
methods: {
appCallBack(data) {
if (data.trigger == 'left_button_click') {
this.$jump({
flag: 'service'
})
}
}
}
}
</script>