我想在 NuxtJs 页面中检查Pusherjs
from的连接状态。$echo
当我使用:
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
那么如何实时通知连接状态呢?