Skip to content

fix props validation fails (#3183) #3193

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 1 commit into from
Jul 1, 2016

Conversation

kazupon
Copy link
Member

@kazupon kazupon commented Jun 30, 2016

No description provided.

@@ -122,6 +123,9 @@ export function compileProps (el, propOptions, vm) {
} else if ((value = getAttr(el, attr)) !== null) {
// has literal binding!
prop.raw = value
} else if (propsData && (value = propsData[attr]) !== null) {
Copy link
Member

Choose a reason for hiding this comment

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

attr is hyphenated, but the user may use camelCase prop names in propsData. We need to check both propsData[attr] and propsData[name].

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe user can only use camelCase propsData[path]?

Copy link
Member

Choose a reason for hiding this comment

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

True, that makes more sense. then we should just replace attr with name here.

@kazupon kazupon force-pushed the fixes/prop-validation branch from 6d53393 to 757da7d Compare July 1, 2016 02:38
@kazupon
Copy link
Member Author

kazupon commented Jul 1, 2016

Thanks review!
I fixed.

@yyx990803 yyx990803 merged commit a683e0f into vuejs:dev Jul 1, 2016
@kazupon kazupon deleted the fixes/prop-validation branch July 1, 2016 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants