element-ui 组件报错:
Vue warn]:
Invalid prop: type check failed for prop "min".
Expected Number with value 0, got String with value "0".
出错位置:
- <el-form-item label="排序" prop="sort">
- <el-input-number v-model="person.sort" controls-position="right" min="0" />
- </el-form-item>
应改为:
- <el-form-item label="讲师排序" prop="sort">
- <el-input-number v-model="teacher.sort" controls-position="right" :min="0" />
- </el-form-item>
错误原因:min max 之类,使用组件的话应为 :min :max
尚硅谷谷粒学院p93,如果出现Invalid prop: type check failed for prop image. Expected String, got Undefined的,原因是组件文件夹component中panThumb中的模板标签image是一个String,只需要将teacher.avatar用String包裹起来,即String(teacher.avatar)即可
即:在save.vue中头衔缩略图的注释下
<pan-thumb :image="String(teacher.avatar)"/>
转自(https://blog.csdn.net/yssa1125001/article/details/106102235)