vanX.reactive not working as expected? #194
Answered
by
Tao-VanJS
cipriano200
asked this question in
Q&A
-
Code:
Button click not increment or decrementing the count. |
Beta Was this translation helpful? Give feedback.
Answered by
Tao-VanJS
Dec 15, 2023
Replies: 1 comment 1 reply
-
Hi, To make it work, you need to change Here is a preview link for the code after fixing this: https://jsfiddle.net/7zL36pxs/8/. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Tao-VanJS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
To make it work, you need to change
data.count
to() => data.count
. See https://vanjs.org/x#caveat-access-sub-field for more information.Here is a preview link for the code after fixing this: https://jsfiddle.net/7zL36pxs/8/.