Invalid prop: type check failed for prop "value". Expected Number, String, got Object
时间: 2023-08-26 19:09:59 浏览: 199
解决vue props传Array/Object类型值,子组件报错的情况
5星 · 资源好评率100%
回答: 这个错误提示是因为在组件的prop属性"value"中,期望的类型是Number或String,但实际传入的是一个Object类型的值。\[3\]根据错误提示,我们可以看到组件ElCascader的value属性期望的类型是数组,而你传入的是一个对象类型的值,所以导致了类型校验失败的错误。你需要确保传入的value属性是一个数组类型的值,而不是对象类型的值。
#### 引用[.reference_title]
- *1* *3* [Invalid prop: type check failed for prop value](https://blog.csdn.net/niaonao/article/details/98593460)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Invalid prop: type check failed for prop “value”. Expected String, Number, got Array](https://blog.csdn.net/gaoyu007/article/details/118898535)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文