Subscribe on changes!

watch props exception

avatar
May 10th 2022

Version

3.2.33

Reproduction link

sfc.vuejs.org/

Steps to reproduce

input content observation

What is expected?

watch does not fire

What is actually happening?

Input content triggers watch,If the props object is a Proxy then everything works


Do not trigger watch when entering content, only when the props object changes

avatar
May 10th 2022

The correct example

avatar
May 10th 2022

image

write like this in template, every render will generate a new object.

image

value and oldValue is different object.

image

avatar
May 10th 2022

This is expected behavior when passing an inline object, as it's a new one on every re-render.

avatar
May 11th 2022

The correct example

@liulinboyi This will not trigger the watch, use reactive or ref it's normal