table的show-overflow-tooltip无法在tree上使用,经发现,简单的样式设置即可达到效果
<span slot-scope="{ node, data }" class="custom-tree-node showname" :title="node.label" v-text="node.label">
</span>
.showname{
width: 63px; // 定宽
overflow: hidden !important;// 溢出部分隐藏
white-space: nowrap !important;//禁止自动换行
text-overflow:ellipsis !important;// 使溢出部分以省略号显示
display: block !important;
}
重点在showname和 :title="node.label" v-text="node.label"