Subscribe on changes!

I am very confused, why this watch can triggered?

avatar
Jun 21st 2021

Version

3.1.1

Reproduction link

https://codesandbox.io/s/quirky-microservice-snj0b?file=/src/App.vue

Steps to reproduce

click the button

What is expected?

watch cannot triggered

What is actually happening?

watch is triggered

avatar
Jun 21st 2021

you should:

<Comp :config="config" />

setup(){
const config = {a:1}
return{
    ...
    config
    }
}
avatar
Jun 21st 2021

By passing the object directly as a prop, every render creates a new object, effectively triggering the watcher.


Please, next time consider using the forum, the Discord server or StackOverflow for questions first. But feel free to come back and open an issue if it turns out to be a bug 🙂