做招聘网站需要人力资源许可,企业邮箱申请域名,收费网站怎么建立,个人能申请网站吗使用uni-appvue2开发微信小程序时遇到一个界面之前传参的问题。想实现的逻辑是界面返回并通知前一个界面刷新。代码如下#xff1a;
GroupManager.getInstance().addGroupRemote(this.createGroupModel(), () {uni.hideLoading()uni.showToast({icon: successvue2开发微信小程序时遇到一个界面之前传参的问题。想实现的逻辑是界面返回并通知前一个界面刷新。代码如下
GroupManager.getInstance().addGroupRemote(this.createGroupModel(), () {uni.hideLoading()uni.showToast({icon: success,title: 保存成功})this.getOpenerEventChannel().emit(refreshGroup)uni.navigateBack()
}, e {uni.hideLoading()uni.showToast({icon: error,title: 保存失败})
})
结果运行的时候报错TypeError: _this4.getOpenerEventChannel(...).emit is not a function
网上查也没发现什么线索后来想了很久才意识到我要返回的界面并不是跳转过来的上一个界面。整个跳转逻辑是界面A跳转到界面B界面B重定向到界面C然后界面C返回界面A。
uni.redirectTo({url: /pages-group/pages/group-detail/index?isEditfalsegroupType${item.groupType}floorId${this.floorId}roomId${this.roomId},
})
中间的界面B在跳转界面C的时候以及从栈中推出而这个getOpenerEventChannel我猜是会从上一个直接跳转过来的界面界面B中找事件通道自然是找不到的。
最后把redirectTo改成了navigateToC界面先返回到B界面B界面再向A界面发射刷新事件。问题就解决了。