mirror of https://github.com/ElemeFE/element
Select: add fix-dropdown-width property
parent
55bac06f0f
commit
fb26205423
|
@ -553,6 +553,7 @@ If the binding value of Select is an object, make sure to assign `value-key` as
|
|||
| default-first-option | select first matching option on enter key. Use with `filterable` or `remote` | boolean | - | false |
|
||||
| popper-append-to-body| whether to append the popper menu to body. If the positioning of the popper is wrong, you can try to set this prop to false | boolean | - | true |
|
||||
| automatic-dropdown | for non-filterable Select, this prop decides if the option menu pops up when the input is focused | boolean | - | false |
|
||||
| fix-dropdown-width | Whether to fix the width of the dropdown, the same as the Select | boolean | - | false |
|
||||
|
||||
### Select Events
|
||||
| Event Name | Description | Parameters |
|
||||
|
|
|
@ -560,6 +560,7 @@ Si el valor de encuadernación de Select es un objeto, asegúrese de asignar `va
|
|||
| default-first-option | seleccione la primera opción de coincidencia en la tecla enter. Uso con `filterable` o `remote`. | boolean | - | false |
|
||||
| popper-append-to-body| si añadir o no el menu popup al body. Si el posicionamiento del popup es incorrecto, puede intentar poner este `prop` en `false`. | boolean | - | true |
|
||||
| automatic-dropdown | para non-filterable Select, este `prop` decide si el menú de opciones aparece cuando la entrada está enfocada | boolean | - | false |
|
||||
| fix-dropdown-width | Whether to fix the width of the dropdown, the same as the Select | boolean | - | false |
|
||||
|
||||
### Eventos Select
|
||||
| Nombre | Descripción | Parámetros |
|
||||
|
|
|
@ -556,6 +556,7 @@ Si la valeur de Select est un objet, assurez-vous d'utiliser `value-key` comme i
|
|||
| default-first-option | Sélectionne la première option avec Entrée. Utilisable avec `filterable` ou `remote` | boolean | - | false |
|
||||
| popper-append-to-body| Si le menu déroulant doit être ajouté au body. Si le positionnement du menu est incorrect, essayez de mettre cette option à `false`. | boolean | - | true |
|
||||
| automatic-dropdown | Pour les sélecteurs non filtrables, détermine si le menu apparaît au focus du champ. | boolean | - | false |
|
||||
| fix-dropdown-width | Whether to fix the width of the dropdown, the same as the Select | boolean | - | false |
|
||||
|
||||
### Évènements de Select
|
||||
|
||||
|
|
|
@ -548,6 +548,7 @@
|
|||
| default-first-option | 在输入框按下回车,选择第一个匹配项。需配合 `filterable` 或 `remote` 使用 | boolean | - | false |
|
||||
| popper-append-to-body | 是否将弹出框插入至 body 元素。在弹出框的定位出现问题时,可将该属性设置为 false | boolean | - | true |
|
||||
| automatic-dropdown | 对于不可搜索的 Select,是否在输入框获得焦点后自动弹出选项菜单 | boolean | - | false |
|
||||
| fix-dropdown-width | 是否固定下拉框的宽度,跟 Select 相同 | boolean | - | false |
|
||||
|
||||
### Select Events
|
||||
| 事件名称 | 说明 | 回调参数 |
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div
|
||||
class="el-select-dropdown el-popper"
|
||||
:class="[{ 'is-multiple': $parent.multiple }, popperClass]"
|
||||
:style="{ minWidth: minWidth }">
|
||||
:style="{ [fixDropdownWidth ? 'width': 'min-width']: minWidth }">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -41,6 +41,11 @@
|
|||
appendToBody: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
|
||||
fixDropdownWidth: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -109,6 +109,7 @@
|
|||
<el-select-menu
|
||||
ref="popper"
|
||||
:append-to-body="popperAppendToBody"
|
||||
:fix-dropdown-width="fixDropdownWidth"
|
||||
v-show="visible && emptyText !== false">
|
||||
<el-scrollbar
|
||||
tag="ul"
|
||||
|
@ -304,6 +305,10 @@
|
|||
popperAppendToBody: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
fixDropdownWidth: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue