0


Element ui 修改table表格行高

 <el-table
        v-loading="dataListLoading"
        :data="dataList"
        style="width: 100%"
        ref="tables"
        class="tab"
        :row-style="iRowStyle"
        :cell-style="iCellStyle"
        :header-row-style="iHeaderRowStyle"
        border
        :header-cell-style="{
          background: 'rgba(194, 210, 255, 0.3)',
          color: '#040415',
        }"
        @selection-change="dataListSelectionChangeHandle"
        :row-key="getRowsKey"
      >

关键代码:

:row-style="iRowStyle"

    :cell-style="iCellStyle"

    :header-row-style="iHeaderRowStyle"
  computed: {
    iRowStyle: function ({ row, rowIndex }) {
      return 'height:30px';
    },
    iHeaderRowStyle: function ({ row, rowIndex }) {
      return 'height:30px';
    },
    iCellStyle: function ({ row, column, rowIndex, columnIndex }) {
      return 'padding:0px'
    },
  },

效果:

标签: vue.js elementui 前端

本文转载自: https://blog.csdn.net/weixin_67271921/article/details/129436857
版权归原作者 键盘打烂月入过万 所有, 如有侵权,请联系我们删除。

“Element ui 修改table表格行高”的评论:

还没有评论