<el-table
empty-text=“正在加载中…”
:data=“contentList”
style=“width: 100%”
@sort-change=“sort”
class=“pro-table-item”
tooltip-effect=“dark”

 <template v-for="(item,index) in titleList">
     <el-table-column
          v-if="index == '0'"
          :prop="index.toString()"
          :label="item"
          sortable="custom"
          min-width="120"
          :render-header="renderHeader"
     >  
     </el-table-column>
      <el-table-column
           v-else
           :prop="index.toString()"
          :label="item"
          min-width="120"
          :render-header="renderHeader"
          show-overflow-tooltip


  

renderHeader(h, { column }) {
if(column.label.length>13) {
return (

{column.label}

)
} else {
return (
{column.label}
)
}
},
并不想让所有的表头都弹出tooltip,只想让超出长度并且

overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;

Logo

前往低代码交流专区

更多推荐