Reputation: 129
in vue guide doc, I have looked at the documentation about prop validation :
The type can be one of the following native constructors:
String
Number
Boolean
Function
Object
Array
In addition, type can also be a custom constructor function and the assertion will be made with an instanceof check.
so, how can I use the instanceof operator to achieve parameter custom type checking ?
Upvotes: 2
Views: 1775
Reputation: 129
you can use custom type like:
props: {
file: { type: File, required: true }
}
Upvotes: 1