[Vue warn]: Invalid prop: type check failed for prop “disabled“. Expected Boolean, got String

问题:

[Vue warn]: Invalid prop: type check failed for prop “disabled”. Expected Boolean, got String

意思是prop期待传入布尔值,而你传入的却是字符串,类型错误。

解决思路:

1、首先去vue文件中查找disabled关键字,确定传入的值是否为Boolean类型。

2、如果使用ElementUI,则需要在disabled前面加上冒号,例如

:disabled="true"

查看Element官网可知,设置输入框组件禁止输入的正确写法为 :disabled=“true”

posted @ 2020-11-30 11:53  FZlion  阅读(3752)  评论(0编辑  收藏  举报