-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
Null prop value now interpreted as a value, rather than null, meaning the default isnt used. #3135
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
Comments
I think this was intentional. /cc @phanan, I recall you mentioning it. |
Thanks @simplesmiler. I wondered if that might have been the case. Gotta love breaking changes :) Not sure how I would send in undefined. Currently I send in either a json_encoded php array, or null. I can change null to something else but how would I send in undefined? If I send as a string it fails as the prop expects an array. Plus it would compile as a string anyway, even if it didn't fail. I could send an empty array but then it obviously stays as an empty array and doesnt fallback to the default prop value. I feel that null would have made more sense when bridging from php to js... |
Something like |
Ok thank you. Seems it has to be explicitly set as opposed to being set from a php callback. Its being sent as a string in that latter case which is causing Vue to squawk. In the former (like your example above) it works fine and is recognised as JS undefined. |
FYI, the previous misbehavior (treating |
|
Hi,
Vue.js version
1.0.25
Reproduction Link
http://jsfiddle.net/st5bak15/2/
This break occurred after upgrading to 1.0.25. It worked as (I) expect in 1.0.24 and below...
What's Happening?
Previously I was defining a prop value on a component as either a json object, or null, depending on whether it was defined or not.
In the case of the prop value being null, Vue would default to using the defined prop default from the component, rather than explicitly null.
However, now the opposite is happening. When null is sent in as the prop value, the prop value remains as null, rather than being recognised as null and then loading up the default value.
Not sure if this was an intended change or not but thought Id highlight it as it has broke my app.
Cheers
Lee
The text was updated successfully, but these errors were encountered: