方案:
el-tooltip支持添加自定义class,通过popper-class进行添加
代码示例:
html
<el-tooltip :content="content" placement="top" popper-class="tooltip-width"> <el-button>Dark</el-button> </el-tooltip>
data
content: "Every single time you access a website, you leave tracks.",
style
<style lang="less"> .tooltip-width { max-width: 200px; }
注:style不能设置scoped,否则样式不会生效
展示效果
标签:el,style,tooltip,width,提示框,class From: https://www.cnblogs.com/applesky/p/17044460.html