Skip to content

事件总线event三个方法分别用于什么场景? #33

@qq229338869

Description

@qq229338869

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions