element-ui使用

作者: 不爱去冒险的少年y | 来源:发表于2019-05-29 10:59 被阅读0次

一、table表格行样式

  • cell-style 样式设置
  1. <el-table>中设置:cell-style="cellStyle"cellStyle为样式回调方法
 <el-table :data="tableData" border class="table"  
                :cell-style="cellStyle" style="font-size:10px">
  1. 编写cellStyle回调方法:
    // 设置表格样式
    cellStyle({row, column, rowIndex, columnIndex}){
      return "padding:0"  #样式
    },

结果如下:


padding:0
注意:如果直接在<el-table>中设置cell-style="padding:0"运行会报错:Invalid prop: type check failed for prop "cellStyle". Expected Object, Function, got String with value . 因为cell-style接受一个function/object,不能是String

相关文章

网友评论

    本文标题:element-ui使用

    本文链接:https://www.haomeiwen.com/subject/xesetctx.html