(iView)表格过长省略显示且提示
效果:
写法:
data(){
return:{
columns: [
{
type: "selection",
align: "center",
width: 60,
},
{
title: "名称",
key: "chinese",
align: "center",
ellipsis: true, //1.只起省略隐藏,没有提示
// 2.省略加提示写法
render: (h, params) => {
return h(
"div",
{
//重点(不然省略号不出来):
style: {
overflow: "hidden",
textOverflow: "ellipsis",
},
},
[
h(
"span",
{
style: {
// display: "inline-block", //此属性会使当前列和其他不在同一水平线上
width: "100%",
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
},
domProps: {
title: params.row.chinese,
},
},
params.row.chinese
),
]
);
},
},
...
...
]
}
}
解决参考:https://blog.csdn.net/zzzz121380/article/details/126059994