element ui plus select
时间: 2023-09-29 08:07:39 浏览: 215
Element UI Plus的Select组件是基于Element UI的Select组件进行增强和扩展的。它提供了更多的功能和定制选项。
在Element UI Plus的Select组件中,可以通过设置`teleported`属性为`false`,将下拉框插入到父级元素中而不是body元素下。示例代码如下:
```html
<el-select class="search-select" v-model="queryParams.exceptionType" placeholder="选择工作状态" :suffix-icon="IconDropDown" clearable :fit-input-width="true" popper-class="search-select-option" :teleported="false">
<el-option label="正常" value="0"></el-option>
<el-option label="异常" value="1"></el-option>
</el-select>
```
同时,可以通过自定义样式来修改Select组件的外观和弹层位置。示例样式代码如下:
```css
/* el-select 自定义样式(用于选择框) */
.search-select {
.el-input__wrapper {
border-radius: 8px;
height: 44px;
padding: 0 10px 0 10px;
}
.el-input__suffix-inner > :first-child {
margin: 0;
width: 32px;
height: 44px;
}
.el-popper {
top: 46px !important;
}
}
.search-select-option {
box-shadow: none !important;
border-radius: 8px;
.el-select-dropdown {
border: 1px solid #147AFC !important;
box-shadow: none !important;
border-radius: 8px;
}
.el-select-dropdown__item {
padding: 0;
margin: 0 16px;
height: 39px;
line-height: 39px;
border-bottom: 1px solid #E8EBF0;
color: #84878D;
font-size: 16px;
font-family: 'AlibabaPuHuiTi-2-55-Regular';
font-weight: normal;
}
.el-select-dropdown__item:last-child {
border-bottom: none;
}
.el-select-dropdown__list {
margin: 9px 0 !important;
}
.el-select-dropdown__item.hover,
.el-select-dropdown__item:hover {
background-color: transparent;
}
.el-select-dropdown__item.selected {
color: #147AFC;
}
}
```
通过这样的设置和样式修改,可以实现对Element UI Plus的Select组件的定制化需求。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [element-plus修改el-select下拉框的位置](https://blog.csdn.net/qq_43651168/article/details/130712253)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [详解为element-ui的Select和Cascader添加弹层底部操作按钮](https://download.csdn.net/download/weixin_38544781/12928496)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文