iview tooltip: true, 处理文字,溢出用点代替
作者:互联网
{
title: ‘老师标签’,
key: ‘tags’,
align: ‘center’,
minWidth: 100,
ellipsis: true,
tooltip: true,
render: (h, params) => {
// 处理文字,溢出用点代替
let txt;
if (params.row.tags) {
txt = params.row.tags.join(’,’);
}
let tableTxt = null;
if (txt) {
if (txt.length > 5) {
tableTxt = txt.substring(0, 5) + ‘…’;
} else {
tableTxt = txt;
}
}
let str = ‘-’;
if (params.row.tags) {
str = params.row.tags.join(’,’);
}
return (
{tableTxt}
);
}
}
标签:用点,let,tags,tooltip,params,tableTxt,txt,true,row 来源: https://blog.csdn.net/sinat_36017053/article/details/122491705