feat(core): 增强核心事件通讯总线,增强跨组件交互能力
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
minScrollTop: 100, // 设置回到顶端按钮显示要求,最小页面滚动距离
|
||||
wechatQrcode: '', // 公众号二维码
|
||||
diyRoute: '/pages/index/index'
|
||||
};
|
||||
@@ -16,8 +17,17 @@ export default {
|
||||
|
||||
},
|
||||
onShow() {
|
||||
// 获取关注公众号二维码
|
||||
this.getFollowQrcode();
|
||||
},
|
||||
mounted() {
|
||||
// 监听图片点击事件
|
||||
this.unsubscribe = this.$eventBus?.on('pictureTap', this._handleDiyGroupInteractionEvent);
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 移除图片点击事件监听
|
||||
if (this.unsubscribe) this.unsubscribe();
|
||||
},
|
||||
methods: {
|
||||
// 关注公众号
|
||||
getFollowQrcode() {
|
||||
@@ -37,5 +47,17 @@ export default {
|
||||
officialAccountsClose() {
|
||||
this.$refs.officialAccountsPopup.close();
|
||||
},
|
||||
// 统一处理点击及触摸事件
|
||||
_handleDiyGroupInteractionEvent(payload) {
|
||||
if (this.storeToken) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 打开登录弹窗
|
||||
this.$refs.login?.open();
|
||||
|
||||
// 阻止事件继续传播
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user