Commit cb936457 authored by hetech's avatar hetech Committed by Jikkai Xiao

Autocomplete: add `popper-append-to-body` attribute (#12241)

parent 8de71d0c
...@@ -712,6 +712,7 @@ Attribute | Description | Type | Options | Default ...@@ -712,6 +712,7 @@ Attribute | Description | Type | Options | Default
| prefix-icon | prefix icon class | string | — | — | | prefix-icon | prefix icon class | string | — | — |
| suffix-icon | suffix icon class | string | — | — | | suffix-icon | suffix icon class | string | — | — |
| hide-loading | whether to hide the loading icon in remote search | boolean | — | false | | hide-loading | whether to hide the loading icon in remote search | boolean | — | false |
| popper-append-to-body | whether to append the dropdown to body. If the positioning of the dropdown is wrong, you can try to set this prop to false | boolean | - | true |
### Autocomplete Slots ### Autocomplete Slots
......
...@@ -691,6 +691,7 @@ Atributo | Descripción | Tipo | Opciones | Por defecto ...@@ -691,6 +691,7 @@ Atributo | Descripción | Tipo | Opciones | Por defecto
| prefix-icon | prefix icon class | string | — | — | | prefix-icon | prefix icon class | string | — | — |
| suffix-icon | suffix icon class | string | — | — | | suffix-icon | suffix icon class | string | — | — |
| hide-loading | si se debe ocultar el icono de loading en la búsqueda remota | boolean | — | false | | hide-loading | si se debe ocultar el icono de loading en la búsqueda remota | boolean | — | false |
| popper-append-to-body | whether to append the dropdown to body. If the positioning of the dropdown is wrong, you can try to set this prop to false | boolean | - | true |
### Autocomplete Slots ### Autocomplete Slots
......
...@@ -864,6 +864,7 @@ export default { ...@@ -864,6 +864,7 @@ export default {
| prefix-icon | 输入框头部图标 | string | — | — | | prefix-icon | 输入框头部图标 | string | — | — |
| suffix-icon | 输入框尾部图标 | string | — | — | | suffix-icon | 输入框尾部图标 | string | — | — |
| hide-loading | 是否隐藏远程加载时的加载图标 | boolean | — | false | | hide-loading | 是否隐藏远程加载时的加载图标 | boolean | — | false |
| popper-append-to-body | 是否将下拉列表插入至 body 元素。在下拉列表的定位出现问题时,可将该属性设置为 false | boolean | - | true |
### Autocomplete Slots ### Autocomplete Slots
| name | 说明 | | name | 说明 |
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
visible-arrow visible-arrow
:class="[popperClass ? popperClass : '']" :class="[popperClass ? popperClass : '']"
:popper-options="popperOptions" :popper-options="popperOptions"
:append-to-body="popperAppendToBody"
ref="suggestions" ref="suggestions"
:placement="placement" :placement="placement"
:id="id"> :id="id">
...@@ -116,7 +117,11 @@ ...@@ -116,7 +117,11 @@
type: String, type: String,
default: 'bottom-start' default: 'bottom-start'
}, },
hideLoading: Boolean hideLoading: Boolean,
popperAppendToBody: {
type: Boolean,
default: true
}
}, },
data() { data() {
return { return {
......
...@@ -65,6 +65,9 @@ export declare class ElAutocomplete extends ElementUIComponent { ...@@ -65,6 +65,9 @@ export declare class ElAutocomplete extends ElementUIComponent {
/** Whether to hide the loading icon in remote search */ /** Whether to hide the loading icon in remote search */
hideLoading: boolean hideLoading: boolean
/** Whether to append the dropdown to body */
popperAppendToBody: boolean
/** /**
* Focus the Input component * Focus the Input component
*/ */
......
...@@ -69,6 +69,9 @@ export declare class ElSelect extends ElementUIComponent { ...@@ -69,6 +69,9 @@ export declare class ElSelect extends ElementUIComponent {
/** Select first matching option on enter key. Use with filterable or remote */ /** Select first matching option on enter key. Use with filterable or remote */
defaultFirstOption: boolean defaultFirstOption: boolean
/** Whether to append the popper menu to body */
popperAppendToBody: boolean
/** /**
* Focus the Input component * Focus the Input component
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment