如題:最新版本的element-ui 關於table row-style 失效
之前是return str 樣式字符串,新文檔需要返回Object,因此需要改變
<el-table :data="tableData" :row-style="showRow" ></el-table> methods: { showRow({row, rowIndwx}) { let styleJson = {} if (row.show) { styleJson = { 'display': 'block' } } else { styleJson = { 'display': 'none' } } return styleJson // 返回對象 } }
這樣就可以生效了