1. Modify the text prompt background of element-ui tooltip:
The first step: (set the class for the tooltip first: popper-class to prevent the styles of other parts from being overwritten, as shown below;)
<el-tooltip popper-class="tps" enterable content="这是提示内容。"placement="bottom">
<i class="el-icon-warning-outline"></i>
</el-tooltip>
The second step: (The following codes can be selected according to the actual situation;)
.tps.el-tooltip__popper {
background: red;
}
// 深色系可以添加一个类 is-dark
.tps.el-tooltip__popper.is-dark {
background: red;
}
// 系可以添加一个类 is-light
.tps.el-tooltip__popper.is-light {
background: red;
}
2. Element-ui tooltip text prompt triangle color modification
Description: .el-tooltip__popper[x-placement^="direction"] .popper__arrow:after
border-direction-color: red
.el-tooltip__popper[x-placement^="direction" ”].popper__arrow
border-direction-color: red
The code is as follows: (Note: If there is a background color, please write the transparency separately, as shown below)
.el-tooltip__popper[x-placement^="top"] .popper__arrow:after,
.el-tooltip__popper[x-placement^="top"] .popper__arrow {
border-top-color: red;
opacity: 0.5;
}
3. Modify the style of show-overfloe-tooltip in el-table
<el-table
:data="tableData"
:max-height="'753'"
:tooltip-effect="'tooltipStyle’” //重点
>
<el-table-column
prop="replacereason"
label="更改原因"
:show-overflow-tooltip="true"
></el-table-column>
</el-table>
.is-tooltipStyle {
background: #fff;
color: #3759af;
border: 1px solid rgb(158, 157, 157);
font-size: 15px;
}