方法一
<Tooltip placement="bottom">
<Button>Multiple lines</Button>
<div slot="content" style="white-space: normal;">
A balloon appears when the mouse passes over this text
</div>
</Tooltip>
方法二
render: (h, params) => {
let texts = '';
if (params.row.content !== null) {
if (params.row.content.length > 6) {
texts = params.row.content.substring(0, 6) + ".....";
} else {
texts = params.row.content;
}
}
return h('div', [
h('Tooltip', {
props: {
placement: 'bottom',
},
style: {
cursor: 'pointer',
}
}, [
texts,
h('div', {
slot: 'content',
style: {
whiteSpace: 'normal'
}
}, params.row.content
)
])
]);
}