element UI 之table表格表頭過長使用點點...顯示,並添加鼠標移入懸浮顯示


需求:

 

 

鼠標移入表頭:

 

 

1、樣式中添加

.el-table .cell {
word-break: keep-all !important;
white-space: nowrap !important;
}
2、在需要懸浮顯示的表頭文字過長處添加

:show-overflow-tooltip="true"
:render-header="renderHeader"

3、methods中添加:

renderHeader(h, data) {
return h("span", [
h(
"el-tooltip",
{
attrs: {
class: "item",
effect: "dark",
content: data.column.label,
placement: "top",
},
},
[h("span", data.column.label)]
),
]);
},
————————————————
版權聲明:本文為CSDN博主「小檸檬愛編程」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/hong521520/article/details/119644719


免責聲明!

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



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