Skip to content

Vue SFC Playground different watchEffect results compared to local project #11575

Discussion options

You must be logged in to vote

The local behaviour is correct. The code behaves differently in the playground because it monkeypatches the console.log calls, and in that code it stringifies the arguments to send it from the iframe to the parent playground app.

So this is more of a playground bug than a Vue bug.

So why is the local code correct? because your watchEffects only depend on the value of the ref as a whole, not on any specific object property or array item.

So when you change a specific object property or add an array item, the effect doesn't see a reason to re-run, because the effect's code never accesses those changed properties / Array items.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mdoesburg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants