Answer the question
In order to leave comments, you need to log in
How to correctly pass props to a component?
Gives an error if default is empty, how is this solved correctly?
props: {
orderId: { type: Number, default: ''},
companyId: { type: Number, default: ''},
financeId: { type: Number, default: ''},
orderServiceId: { type: Number, default: ''},
},
vue.common.dev.js:630 [Vue warn]: Invalid prop: type check failed for prop "orderId". Expected Number with value 0, got String with value "".
found in
---> at resources/js/components/task/CreateTask.vue
at resources/js/views/Tasks.vue
at resources/js/views/App.vue
Answer the question
In order to leave comments, you need to log in
Does the translator not translate anymore? It clearly states that the Number type expects a number, such as 0 . If you really want to specify empty strings, then change the type to String .
And learn to read the documentation already.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question