-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
.number modifier should work with select, radio, checkbox (fix #4018) #4022
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
Conversation
function genCheckboxModel ( | ||
el: ASTElement, | ||
value: string, | ||
modifiers: ?Object |
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.
Is modifiers type {[key: string]: true}
more specific? Reference: https://github.com/vuejs/vue/blob/dev/flow/compiler.js#L46
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.
I think so. I'll update it
@@ -78,15 +87,19 @@ function genRadioModel (el: ASTElement, value: string) { | |||
'Declare initial values in the component\'s data option instead.' | |||
) | |||
} | |||
const valueBinding = getBindingAttr(el, 'value') || 'null' | |||
const number = modifiers && modifiers.number | |||
let valueBinding = getBindingAttr(el, 'value') || 'null' |
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.
I think a ternary could be used here
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, updated :)
fix #4018