Skip to content

computed 和 watch 不会在自定义组件或页面卸载时自动移除监听吗? #106

Open
@lixilin322

Description

@lixilin322

在写业务逻辑时,发现computedwatch 并不会在自定义组件或页面卸载时自动移除监听,如果watch内部使用了this,也就是当前组件实例或页面实例,则该实例不会被释放,如果多次进入同一页面,watch监听会重复绑定多个,严重影响性能和业务逻辑。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions