uni-app中的页面通讯( uni.$emit和 uni.$on)
使用情景
页面一跳转页面二,在页面二通过APP物理手势返回页面一,不刷新页面一的数据。
使用方法
页面一:
// 监听事件
uni.$on('getCartList', (getCartList) => {
this.cartList[0].goods = getCartList;
})
页面二:
this.$http.post(getCartList, {}).then((res) => {
if (res.code == 0) {
this.$
原创
2020-11-26 19:57:59 ·
2673 阅读 ·
0 评论