<el-table :data="tableData" @row-click="editClick" style="width: 100%;">
<el-table-column align="center" class-name="el-table-title" prop="title" label="标题"></el-table-column>
</el-table>
使用element Ui 的table组件的时候,我想给上面的className:el-table-title
做个限制,
就是用后台返回过来的一个字段isFlay为true才让他有这个class
我改成这个:class-name="{'el-table-title': true}"
虽然是可以了
但他报[Vue warn]: Invalid prop: type check failed for prop "className". Expected String,got Object. (found in component <el-table-column>)
如果我改成这个的话:class-name="{'el-table-title': isFlay === true}"
他报isFlay不存在[Vue warn]: Property or method "isFlay" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.(found in component <demand>)
这个要怎么破!!