-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
fix(runtime-dom): v-model.number work with select tag #2254
Conversation
let domValue: string | number = el.multiple ? selectedVal : selectedVal[0] | ||
|
||
if (castToNumber) { | ||
domValue = toNumber(domValue) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edison1105, I would suggest handling the case of multiple select here.
When the el.multiple
is true, domValue
will be assigned with an array from selectedVal
.
The domValue = toNumber(domValue)
will cast an array of numbers to number.
This will make the multiple select case throw an error of:
<select multiple v-model> expects an Array or Set value for its binding, but got Number.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks~ @69hunter. I will update this.
closed this PR, because the repo of this PR is deleted.😂😂😂. |
fix #2252