Watch handler was called unexpected in vue2 with pinia #1369
Labels
bug
Something isn't working
has workaround
The issue contains a temporary solution to get around the problem
vue 2.x
Specific to Vue 2 usage
Reproduction
https://github.com/reuwi/pinia-vue2-watch-bug-repro/tree/master
Steps to reproduce the bug
Step1: Clone this repo to local
Step2: install dependencies
Step3: open http://localhost:8081/ in browser
Expected behavior
No alert is promoted
Actual behavior
Got an promoted alert with 'lol changed'
Additional information
After some debugging, I guess that the problem may came from initWatch when collect dependencies. When excute get function to add dep, pinia will travers the state object, which cause wrong dependency relation.
The text was updated successfully, but these errors were encountered: