-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strange binding behaviour #4658
Comments
This is an expected behavior in Vue.js 2. When |
@defcc Why this behavior appeared only in Vue 2.1.7+ , not in prev releases. Is this not breaking change? Cause if you say its just how it works, why it start working like that only from release 2.1.7 specific. |
@defcc And if you say that whole template is re-render, why if we change input to textarea, its value not rolled back like input value? |
@defcc If I need submit form with ajax without bind any values to vue, I cant use vue. Is that correct? |
@Rhincodon , I'll have a check on it. |
@Rhincodon This is a very good usecase for |
Thanks @Rhincodon , I'll open this issue. |
In 2.1.7 static value attribute was added to dom property, which introduced the different behavior between the previous version. Related issue: #4530. As for textarea, it's different from input element in internal implemention. |
In fact, Vue will do this automaticly, you don't need to keep it in mind. You could check this doc for more details: https://vuejs.org/v2/api/#v-once. As for this issue, we will fix this case. |
Vue.js version
2.1.7+
Reproduction Link
https://jsfiddle.net/rhinodontypicus/tvcz49bd/
Steps to reproduce
Change input value, click Button -> value rolls back.
What is Expected?
Input value must not be touched at all.
What is actually happening?
Input value rolls back to origin value.
If we remove v-bind:disabled from button, it works as needed — nothing happened.
The text was updated successfully, but these errors were encountered: