Invalid prop: type check failed for prop "showCheckbox". Expected Boolean, got String.
作者:互联网
一个简单的报错 ,可以用于
代码: <el-tree :data="menus" :props="defaultProps" @node-click="handleNodeClick" :expand-on-click-node="false" show-checkbox = "true" :default-expanded-keys="expandedKey" node-key="catId" > Invalid prop: type check failed for prop "showCheckbox". Expected Boolean, got String. 解决方法1.网上搜了一下解决方法 就是直接把这个后面的 = "true" 去掉,亲测有用 <el-tree :data="menus" :props="defaultProps" @node-click="handleNodeClick" :expand-on-click-node="false" show-checkbox :default-expanded-keys="expandedKey" node-key="catId" > 解决方法2.后面发现在前面加一个:绑定一下就行了 :show-checkbox = "true", 注 : 等价于 v-bind: 是一个单向绑定函数,用于绑定数据和元素属性 <el-tree :data="menus" :props="defaultProps" @node-click="handleNodeClick" :expand-on-click-node="false" :show-checkbox = "true" :default-expanded-keys="expandedKey" node-key="catId" >标签:checkbox,String,catId,show,prop,Expected,expandedKey,true 来源: https://www.cnblogs.com/wanglli/p/13229133.html