-
-
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
[template-compiler] Using both v-bind:value and v-model on an input generates code that'S invalid in IE #7048
Comments
I think this can be dealt with by a compile-time warning at the parsing phase (when |
I am getting compiling errors not warnings when I do 'npm run dev' on my code base. @yyx990803 @ @rpemberton @LinusBorg. Just to update I am running vue@2.5.5 and vue-template-compiler@2.5.5. |
You should fix them because they are not supposed to work in the first place. |
Thanks for your reply @yyx990803, removed :value. Thanks |
…js#7056) * test($compile): warn if v-model and :value used on same text input vuejs#7048 * test($compile): make v-model and v-bind:value warning apply to all but exceptions vuejs#7048 * test($compile): move v-model/:value conflict warner to model.js vuejs#7048 * style: split long warning messages onto new lines
…js#7056) * test($compile): warn if v-model and :value used on same text input vuejs#7048 * test($compile): make v-model and v-bind:value warning apply to all but exceptions vuejs#7048 * test($compile): move v-model/:value conflict warner to model.js vuejs#7048 * style: split long warning messages onto new lines
…js#7056) * test($compile): warn if v-model and :value used on same text input vuejs#7048 * test($compile): make v-model and v-bind:value warning apply to all but exceptions vuejs#7048 * test($compile): move v-model/:value conflict warner to model.js vuejs#7048 * style: split long warning messages onto new lines
Version
2.5.3
Reproduction link
https://vuejs.org/v2/guide/render-function.html#Template-Compilation
(Alternative reproduction on jsfiddle: https://jsfiddle.net/Linusborg/pqbppg7a/)
Steps to reproduce
domProps
options:What is expected?
The code should run in all browsers, or throw an error or warning.
What is actually happening?
IE11 throws an error: "duplicate properties not allowed in strict mode".
I realize that using both v-bind:value and v-model on an input is not recommended or even sensible, but it doesn't throw an error or warning when done in modern browsers, and doesn't create any problems if the expression is the same for both, so it can easily be overlooked when added accidentally.
Uglify also doesn't help - it doesn't remove the first occurrence that would otherwise be "overwritten" by the second in modern browsers.
So what would be a sensible solution? I'm not sure.
value
prop on elements of type "input" and drop all but the last occurrence. Possible Problem: performance?The text was updated successfully, but these errors were encountered: