开发者社区> 问答> 正文

如何使此代码计数在线状态中的成员?无法读取未定义的属性“ count”

我使用此代码首先加入状态通道,其次是console.log用户数。我得到错误

未捕获的TypeError:无法读取未定义的属性“ count”

为什么会发生这种情况以及如何使其起作用?

var presenceChannel = Echo.join('presenceChat'); presenceChannel.here((users) => { this.users = users; var count = presenceChannel.users.count; update_member_count(count); console.log(count); console.log(users)

})

展开
收起
被纵养的懒猫 2019-09-30 14:57:03 440 0
0 条回答
写回答
取消 提交回答
问答地址:
问答排行榜
最热
最新

相关电子书

更多
用计算和数据去改变整个世界 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载