Skip to content

When using the deep mode of watch, watchCallBack will be triggered even if the value does not change. #7160

Closed
@LittleSound

Description

@LittleSound

Vue version

all (>=v3.2.16)

Link to minimal reproduction

Steps to reproduce

  1. Open Link to minimal reproduction
  2. Enter some spaces and watch the counter change

What is expected?

Do not call watchCallBack if the value has not changed; for example, if watch is listening for changes to an object in computed and the object's value is undefined for the next few changes, then watchCallBack should not be triggered.

The current behavior of watch in the above case leads to some hidden vulnerabilities that are hard to debug.

What is actually happening?

When using the deep mode of watch, watchCallBack will be triggered even if the value does not change.

System Info

No response

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions