hy-event-store
hy-event-store copied to clipboard
事件总线event三个方法分别用于什么场景?
事件总线event三个方法:on,once,off分别用于什么场景? 我在微信小程序中使用,想在切换组件是发送事件,切换可以不生效。 但是: 使用on时,在切换组件会触发多次,会有错误数据; 使用once时,在切换不生效的情况下,无法发送第二次; 使用off时,报错 Cannot read property 'length' of undefined;