vue 报错Invalid prop: type check failed for prop “span“. Expected Number, with value 2, got String wit
vue 报错Invalid prop: type check failed for prop "span". Expected Number, with value 2, got String wit
·
控制台报错:
错误代码如下:
<el-col span="2">
<el-button
type="primary"
@click="handleFunc"
>
打印
</el-button>
</el-col>
错误原因是:span类型是Number,需要在span前面加上冒号,element-UI文档如下:
Element文档传送门: https://element.eleme.io/#/zh-CN/component/layout
修改后代码:
<el-col :span="2">
<el-button
type="primary"
@click="handleFunc"
>
打印
</el-button>
</el-col>
添加:以后,再无报错。
更多推荐
已为社区贡献4条内容
所有评论(0)