/**
* 表格公用tooltip
* @param {*} h function
* @param {*} title string
* @returns
* 注: 只适用于iview框架, 若其它框架需要使用, 请修改Tooltip标签
*
*/
export const tooltipFun = (h, title) => {
return h('Tooltip', {
props: {
content: title,
maxWidth: 300
}
}, [
h('div', {
style: {
maxWidth: '300px',
overflow: 'hidden',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis'
}
}, title)
])
}
使用方式:
在组件中引入封装好的模块js
调用: tooltipFun (h, ititle)
render函数使用公共Tooltip
于 2023-01-13 17:37:53 首次发布