Thanks for linking that information from the documentation. There are some interesting gotchas for change detection in Vue.
However, it doesn’t apply in this case. Take a look at the screen capture below. It’s recorded from the same pen I embedded in the post.
The computed property is the binary string. Whenever the user changes the string…
- the set function is called
- the string is looped over, changing the pets array along the way
- the checkboxes update with new pets data
- console.log() is executed
Hope this clarifies things a bit.