/*實現表格頭數據換行*/
.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="'數據\n單位'" align="center" show-overflow-tooltip></el-table-column>//
第一種寫法
tableColums:[{prop:'name',label:'數據\n單位'}]//
第二種寫法
