• 周五. 3月 29th, 2024

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

element中使用select组件 下拉框位置偏移的解决方法

admin

11月 28, 2021

起因:缩放屏幕时,下拉框会随着屏幕的缩小或放大而偏移

解决方法:e-select标签中使用popper-class,且搭配:popper-append-to-body=”false”使用,然后设置你需要的样式,他出现的位置就可以了。

      <el-select
            v-model="itemvalue"
            placeholder="请选择"
            @change="getItem"
            :popper-append-to-body="false"
            popper-class="select"
          >
            <el-option
              v-for="item in options"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>

样式设置

/deep/.el-select-dropdown {
  position: absolute !important;
  left: 0px !important;
  border: 1px solid #010f13;
}

《element中使用select组件 下拉框位置偏移的解决方法》有3个想法
  1. Gut Vita™ is a daily supplement that helps consumers to improve the balance in their gut microbiome, which supports the health of their immune system. It supports healthy digestion, even for consumers who have maintained an unhealthy diet for a long time. https://gutvitabuynow.us/

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注