使用
popper-class
为
Tooltip
的
popper
添加类名
<el-tooltip
effect="dark":content="row.range"
placement="top-start"
popper-class="tool-tip"><div class="td-nowrap">{{ row.range }}</div></el-tooltip>
在当前组件新建一个
style
,不要写
scoped
,这里的样式会应用到全局,所以
class
命名一定要保证不要和全局别的类名重复
<style lang="scss" scoped>.td-nowrap {
white-space: nowrap;overflow: hidden;
text-overflow: ellipsis;}</style><style>.tool-tip {
max-width: 400px;}</style>
当然,也可以用
slot
,在
slot
中自定义类名
本文转载自: https://blog.csdn.net/weixin_44157964/article/details/126974233
版权归原作者 胡肖一 所有, 如有侵权,请联系我们删除。
版权归原作者 胡肖一 所有, 如有侵权,请联系我们删除。