ElementUI el-popover弹框背景色设置

1.el-popover样式由于使用了 absolute 属性,导致脱离了节点,所以在父级元素使用class无法进行权重处理来修改其样式,解决方式如下:通过popper-class实现样式处理,避免全局样式污染

javascript 复制代码
// html
<el-popover
      placement="right"
      popper-class="device-popover"
      width="130"
      trigger="click">
          <div>
               Devices with the same IP address as the user
          </div>
</el-popover>

//css 
.device-popover{
   background-color: #ffdf25 !important;
   border-color: #ffdf25 !important;
}
.device-popover .popper__arrow::after{
   border-right-color:#ffdf25 !important;
}
相关推荐
亿元程序员18 分钟前
为什么Cocos都4.0了还有人用2.x?
前端
MomentYY24 分钟前
AI 到底是“懂”,还是在“猜”?
前端·人工智能·ai编程
鹏毓网络科技25 分钟前
Cursor Rules 文件配置实战:3 个隐藏参数让我每月少写 40% 样板代码
前端·github
没烦恼30127 分钟前
无痕模式下 HTTP\-First 拦截引发的“页面刷新”误判
前端
ZhengEnCi28 分钟前
Q02-Vue-React-index.html完全指南
vue.js·react.js·html
文心快码BaiduComate31 分钟前
从个人提效到组织提效:Comate辅助构建自我进化的AI研发系统
前端·程序员
hunterandroid1 小时前
Compose 状态管理:remember、rememberSaveable 与状态提升
前端
星栈1 小时前
Dioxus 接数据库最容易写歪的 3 个地方:sqlx + SQLite 怎么接才顺
前端·rust·前端框架
晴虹1 小时前
vue3-scroll-more:横向滚动条-元素或页签过多滚动显示处理的组件
前端·vue.js
代码搬运媛1 小时前
Claude 全栈开发专用 Rules 配置
前端