element-ui 表格標題換行


 render-header: 列標題 Label 區域渲染使用的 Function

<template>
    <el-table
      :data="dataList">
        <el-table-column
         prop="openRule"
         :label="加密規則|(默認為60%字段加*)"
         :render-header="renderheader">
        </el-table-column>
    </el-table>
</template>
<script>
export default {
  data() {
   return {}
  },
  created() {
  },
  methods: {
    // 表頭換行
    renderheader(h, { column, $index }) {
      return h('span', {}, [
        h('span', {}, column.label.split('|')[0]),
        h('br'),
        h('span', {}, column.label.split('|')[1])
      ]);
    }
    }
}
</script>

效果如下:

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM