【发布时间】:2020-12-14 22:51:00
【问题描述】:
我想在 NuxtJs 页面中从$echo 中检查Pusherjs 的连接状态。
当我使用时:
mounted(){
this.connection = this.$echo.connector.pusher.connection.state;
}
它可以工作,但它只设置了初始连接状态connecting,它是静态的。
但是当我使用时:
computed:{
connection: this.$echo.connector.pusher.connection.state
}
返回错误:
TypeError
Cannot read property '$echo' of undefined
那么如何实时通知连接状态?
【问题讨论】:
标签: laravel-echo pusher-js nuxtjs