Updating values in the store #4343
-
Hello everyone, Apologies if this has already been discussed, but I tried searching the discussions for this, and I couldn't find anything related. I found a problem when working with Setup: HTML:
JS:
The expected behavior (to me) is that when we click each button, the
This one, however, works:
This might be due to the way the reactivity engine works, but since I don't know anything about Vue. I'm also using the CSP build. Not sure if I managed to explain the situation correctly, let me know if I should provide any additional details! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Works fine here: https://awesomealpine.com/play?share=sWff70HDRF8c |
Beta Was this translation helpful? Give feedback.
It's because the value in the store is already
world
. When you click for the second time on the same button, you are not changing the store so nothing will react.You need to change the store value while you type either with x-model or with an input event: https://awesomealpine.com/play?share=N53luoNBuIQC