I appreciate that. Once you get your head around the fact that bound props are basically javascript properties.
In that case, does Vue have a concept of error checking in dev mode? I just helped a beginner who ran in to this issue - I think they could have worked out the issue themselves if they had received something similar to:
[Vue warn] Bound property 'user' should not be empty on component 'test'
Again, happy to try and add this if you think it's useful.
Vue.js version
2.2.4
Reproduction Link
https://jsfiddle.net/wwuyv17z/
Steps to reproduce
Pass nothing to a bound prop such as in the example:
<test :user=""></test>
What is Expected?
At worst I would expect a warning in the console and no crash; at best I would expect the prop to come through with a
null
value to the component.If it is agreed that a warning or null replacement should happen then I am happy to try and pull request this change myself.
What is actually happening?
An error occurs similar to:
The text was updated successfully, but these errors were encountered: