element-ui テーブルとツールチップは背景色と矢印の色を変更します

1. element-ui ツールチップのテキスト プロンプトの背景を変更します。

最初のステップ: (以下に示すように、最初にツールチップのクラスを設定します: Popper-class を使用して、他の部分のスタイルが上書きされないようにします;)

<el-tooltip popper-class="tps" enterable content="这是提示内容。"placement="bottom">
                              
  <i class="el-icon-warning-outline"></i>
                            
</el-tooltip>

2 番目のステップ: (実際の状況に応じて次のコードを選択できます;)

.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 ツールチップ テキスト プロンプトの三角形の色の変更
    説明: .el-tooltip__popper[x-placement^="direction"] .popper__arrow:after
                 border-direction-color: red
                .el-tooltip__popper[x-placement^="direction" " "].popper__arrow
                境界方向の色: 赤

コードは次のとおりです。 (注: 背景色がある場合は、以下に示すように透明度を別途記述してください)

.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. el-table の show-overfloe-tooltip のスタイルを変更する

<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;
}

おすすめ

転載: blog.csdn.net/weixin_42981560/article/details/131491767