vue el-input输入框el-autocomplete下拉列表样式修改

没有检索到摘要

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、自定义样式,最终效果如下图

 常规修改样式代码如下,输入框样式已修改;

/deep/.el-input__inner:focus {
    border: 1px solid #1fb1ef;
  }
  /deep/.el-input__inner {
    border: 1px solid #1fb1ef;
    background: rgba(0, 80, 111, 0.8);
    border-radius: 18px;
    height: 30px;
    color: white;
    line-height: 30px;
    // background: #ffffff3b;
  }
  /deep/.el-input__icon {
    line-height: 30px;
    border-radius: 0 18px 18px 0;
    cursor: pointer;
  }
  /deep/.el-input__suffix {
    background: #1fb1ef;
    right: 1px;
    padding: 0 5px;
    border-radius: 0 18px 18px 0;
    opacity: 0.8;
    color: #fff;
  }

  

点击输入框弹出的下拉列表样式修改无效;解决方法请往下看


  /deep/ .el-autocomplete-suggestion {
    margin-top: 8px;
    border-radius: 6px;
    border: 1px solid #198ec0;
    background: rgba(0, 80, 111, 0.6);
    color: rgba(25, 142, 192,1);
    
    .popper__arrow{
      top: -8px;
      border-bottom-color: rgba(31, 177, 239, 1);
    }
    .popper__arrow::after{
      border-bottom-color: rgba(0, 80, 111, 0.9);
    }
    .el-autocomplete-suggestion__wrap{
      padding: 2px;
    }
  }

  /deep/ .el-autocomplete-suggestion li{
    color: #ffffff;
  }
    
  /deep/ .el-autocomplete-suggestion li:hover {
    background-color: rgba(8, 162, 223, 0.8); 
    border-radius: 6px;
  }

二、下拉列表样式无效解决方法

给 el-autocomplete 组件加上下面属性

:popper-append-to-body="false"

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

向着太阳往前冲

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值