v-for over non-reactive array or object and v-show weird behaviour #11411
CthulhuDen
started this conversation in
General Discussions
Replies: 2 comments
-
Maybe somebody knows who I can ping about it? |
Beta Was this translation helpful? Give feedback.
0 replies
-
Looks like a bug, please open an issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone!
Please see this example
There is static (non-reactive) list of options, and reactive (via ref) list of chosen items. There are buttons which can add items to the set of chosen items.
The buttons are rendered in v-for over the non-reactive list of options, and then button's visibility is supposed to depend on whether or not the current item is in the reactive list of chosen items - you are not supposed to see button when it's item is already in the set of chosen items.
However, it doesn't work reliably. In some cases, like
Buttons wrapped in spans
in the example, text inside the buttons is indeed updated, however the v-show directive is not.Is it the expected behaviour? Should it be documented that the v-for should only be used on reactive collections, even if we do ever modify in any way the collection itself?
Beta Was this translation helpful? Give feedback.
All reactions