two-way binding on a input element,Implementing native attribute "maxlength" with javascript;UI view layer not change #11996
parasol-tree
started this conversation in
General Discussions
Replies: 1 comment 1 reply
-
Vue only re-renders when reactive state changes. Your state doesn't change when a fifth character has been typed, because you cut away that fifth character and then assign that string to the state - but that's the same value that it previously had, so nothing "changed" example:
that also explains why your "line 31" makes it work: it shortly assigns a new value that's actually different from the previous one, hence Vue is scheduling a re-render. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Why does the UI view layer show changes only after adding line 31 of code?
Implementing native attribute "maxlength" with javascript.
Is there something wrong with my code or is this a vue bug?
Vue SFC Playground Link
Beta Was this translation helpful? Give feedback.
All reactions