You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Components with multiple properties might fail property validation at the most inopportune time: assigning one property will trigger property validation for all function initProps (vm, propsOptions). Stack trace will show that the issue was triggered by assigning a specific property "prop1" while validation will actually fail on "prop2". If this is combined with component actually rendering for the first time ("prop1" was the trigger), it will be unclear what property actually failed.
In my case, reported error message was:
[Vue warn]: Invalid prop type: "[object Object]" is not a constructor
This is from method function assertType (value, type, vm)
Clarify for the actual n00b error message I received: I specified prop type to be of an "enum" class declared with Object.freeze. Actual values are, naturally, Number.
What does the proposed API look like?
It would be clearer to add prop name to the message like this:
[Vue warn]: Invalid prop "propName" type: "[object Object]" is not a constructor
This would require to add propName (or just name) parameter to assertType in order to be able to include it in the message
The text was updated successfully, but these errors were encountered:
What problem does this feature solve?
Components with multiple properties might fail property validation at the most inopportune time: assigning one property will trigger property validation for all
function initProps (vm, propsOptions)
. Stack trace will show that the issue was triggered by assigning a specific property "prop1" while validation will actually fail on "prop2". If this is combined with component actually rendering for the first time ("prop1" was the trigger), it will be unclear what property actually failed.In my case, reported error message was:
This is from method
function assertType (value, type, vm)
Clarify for the actual n00b error message I received: I specified prop type to be of an "enum" class declared with Object.freeze. Actual values are, naturally, Number.
What does the proposed API look like?
It would be clearer to add prop name to the message like this:
This would require to add
propName
(or justname
) parameter toassertType
in order to be able to include it in the messageThe text was updated successfully, but these errors were encountered: