[Vue warn]: Invalid prop: type check failed for prop "current". Expected Number, String, got Object found in
时间: 2023-10-18 09:31:09 浏览: 113
2020-web前端-vue项目出错-[Vue warn]: Invalid prop: custom validator check failed for prop “index”.
5星 · 资源好评率100%
根据引用,这个警告是由于在Vue组件的属性(prop)中出现数据类型不匹配的错误。具体来说,在该组件中,"value"属性的类型应该是字符串或数字,但实际上它是一个日期类型的对象。这导致了类型检查失败并产生了警告信息。
引用提到了该警告的原因。即,组件期望接收的数据类型是字符串或数字。而如果将"current"属性初始化为对象类型的话,就会出现这种类型检查失败的情况。
因此,根据引用的解释,为了解决这个问题,您需要将"current"属性初始化为数字或字符串类型的值,而不是对象类型。这样,就能避免出现类型检查失败的警告信息。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [[Vue warn]: Invalid prop: type check failed for prop “value“. Expected String, Number, got Date...](https://blog.csdn.net/weixin_44813394/article/details/126402597)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [[Vue warn]: Invalid prop: type check failed for prop “value“. Expected String, Number, got Array](https://blog.csdn.net/qq_50276105/article/details/131736500)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文