el-select、el-dropdown 下拉框位置偏移
el-dropdown 下拉框位置偏移
<el-dropdown class="nav_item" :class="activeIndex == 2 ? 'active' : ''" > <span class="el-dropdown-link cursor"> 账号交易<i class="el-icon-arrow-down el-icon--right"></i> </span> <el-dropdown-menu slot="dropdown" style="width: 150px;text-align: center;" :append-to-body="false"> <el-dropdown-item> <router-link to="/gameList">我要买号</router-link> </el-dropdown-item> <el-dropdown-item> <router-link to="/account/pushAccount">我要卖号</router-link> </el-dropdown-item> <el-dropdown-item> <router-link to="/recyle">号商回收</router-link> </el-dropdown-item> </el-dropdown-menu> </el-dropdown>
:append-to-body="false" 使下拉内容不插入在Body 中;stye 修改样式宽度
要修改其他样式
.el-dropdown-menu { position: absolute !important; top: 0px !important; left: 0px !important; }
el-dropdown 下拉框中三角形隐藏方法
.el-popper {
overflow: auto;
}
el-select 下拉框位置偏移
<el-select class="chooseSelect" :placeholder="itemS.type" multiple v-for="(itemS, indexNum) in accountChoose.others.select" :key="indexNum" v-model="itemS.chooseValue" @change="changeSele" :popper-append-to-body="false" > <el-option v-for="(item, index) in itemS.list" :key="index" :label="item.label" :value="item.label"> </el-option> </el-select>
添加 :popper-append-to-body="false"
浩楠哥