Subscribe on changes!

v-model not binding with reactive

avatar
Aug 17th 2022

Vue version

^3.2.37

Link to minimal reproduction

https://sfc.vuejs.org/#eNp9UsFu2zAM/RXCFzuAY689BkmwAetlh2VYt1ymHRyHTpTZkibRKYrA/15KdlKnCKKDTUrkI/n4TtEXY7Jji9EsmrvSSkPgkFqzFEo2RluCE1isUv4UJckjpvBSULmHDiqrG4g5N77E/lZ6uM5ytj0wPwpVI8G2oOLnAAKLC15ygmIG8Sc+cQobNq21MXQTn1dq5c6ZVUiqhvgHPueo0FAyxk8hmcBiCSehADyIrjGr9S6Jf+2lA4VHtLAvjEHlYsboUh5zi2hmQLZFuAHMFNzF/Lp6eh4gA2IAmOc9p8wmO4SNqQvC4AHMN5Yt/nvW5HYhovZBRHCcNnqLNbvjiUS0nHtK+wy/HuAzjsiYlhNPcXUFXRcS8j5jVOrxRqnqXpXqqgB7V9jz/DJdlEa9HKZNYbKD04rFFVgTw4MTEUP14CJikXhfRHsi42Z57qrSK+fgMm13OVuZbRXJBjN0zXRj9YtDy8Ai8hDcRMclB7l91DHUhdrxgL7mWNNbrKTCH1Yb90HKZ9WZ8LYYRybcs6DA2bqoWwxDCBJEr4Ydf1abA5aU9tcW/7fS4rZXlb/zzY6UjY2kS4kndlzyJ24NU4yz9zLx35BStYq3qhWUe54JWY0XKRKsGebb8+p7ZgrrMAmmIyvVTlavSZgle0ecMCDAmne4gPhxOH52XqKk5EYLKay9qu+KmpcZZN0ScZefy1qW/5j6vt1Av2eod4E0nAv3KurTBpixnLo35M6Rmw==

Steps to reproduce

  1. Click on the first button. dataReactive (dataReactive = reactive({})) is not updated. Is this a desired effect for reactive? Why?
  2. Click on the second button. dataRef (dataRef = ref({})) does is updated.
  3. WHY when dataRef is updated is also updated dataReactive? WTF.

What is expected?

  1. v-model updating variable declared with reactive.
  2. dataReactive not changed when dataRef changes.

What is actually happening?

  1. v-model not updating variable declared with reactive.
  2. dataReactive changing when dataRef is changed. WTF!

System Info

No response

Any additional comments?

No response

avatar
Aug 18th 2022

This is all expected behavior. I'll move this to Q&A discussions so the community can help you understand.