Skip to content

.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

Merged
merged 5 commits into from
Nov 1, 2016
Merged

.number modifier should work with select, radio, checkbox (fix #4018) #4022

merged 5 commits into from
Nov 1, 2016

Conversation

defcc
Copy link
Member

@defcc defcc commented Oct 24, 2016

fix #4018

@defcc defcc changed the title Number modifier binding should work with select, radio, checkbox (fix #4018) number modifier should work with select, radio, checkbox (fix #4018) Oct 24, 2016
@defcc defcc changed the title number modifier should work with select, radio, checkbox (fix #4018) .number modifier should work with select, radio, checkbox (fix #4018) Oct 24, 2016
function genCheckboxModel (
el: ASTElement,
value: string,
modifiers: ?Object

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

Copy link
Member Author

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'
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, updated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Model .number modifier fails to cast selected value of select element.
4 participants