Subscribe on changes!

Abount Reactivity between vue2 and vue3

avatar
Apr 27th 2021

Version

3.0.11

Reproduction link

https://codepen.io/qiulijun/pen/xxgBMqG

Steps to reproduce

  1. open the link
  2. You will see that obj.done = false is not work, but vue2 is ok

What is expected?

drive to render as expected

What is actually happening?

not render


I know following is work:

const obj = reactive({ done: true })

obj.done = false

but, is there any other way?

avatar
Apr 27th 2021

This is expected, do not manipulate the original data in Vue3

avatar
Apr 27th 2021

@LeeJim Change: obj.done = false To: this.items[this.items.length-1].done=false can also achieve responsiveness.