elementUI el-table 表格头数据换行

/*实现表格头数据换行*/
.el-table .cell {
    /*text-align: center;*/
    white-space: pre-line;/*保留换行符*/
}

  写法:   

                              <el-table-column v-for="(item,index) in tableColums" :key="index"
                                                                     :prop="item.prop"
                                                                     :label="item.label"
                                                                     :width="item.width"
                                                                     align="center"
                                                                     show-overflow-tooltip>
                                                    </el-table-column>
  
                               
                               
                               

  

<el-table-column prop="name" :label="'数据
单位'" align="center" show-overflow-tooltip></el-table-column>//
第一种写法

  

tableColums:[{prop:'name',label:'数据
单位'}]//
第二种写法

  

原文地址:https://www.cnblogs.com/dyy-dida/p/11276530.html