Commit 38a13de3 authored by 杨奕's avatar 杨奕 Committed by GitHub

Autocomplete: add hide-loading (#11260)

parent 54eeb5ce
...@@ -711,6 +711,7 @@ Attribute | Description | Type | Options | Default ...@@ -711,6 +711,7 @@ Attribute | Description | Type | Options | Default
| label | label text | string | — | — | | label | label text | string | — | — |
| 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 |
### Autocomplete Slots ### Autocomplete Slots
......
...@@ -688,6 +688,9 @@ Atributo | Descripción | Tipo | Opciones | Por defecto ...@@ -688,6 +688,9 @@ Atributo | Descripción | Tipo | Opciones | Por defecto
| name | igual que `name` en el input nativo | string | — | — | | name | igual que `name` en el input nativo | string | — | — |
| select-when-unmatched | si se emite un evento `select` al pulsar enter cuando no hay coincidencia de Autocomplete | boolean | — | false | | select-when-unmatched | si se emite un evento `select` al pulsar enter cuando no hay coincidencia de Autocomplete | boolean | — | false |
| label | texto de la etiqueta | string | — | — | | label | texto de la etiqueta | string | — | — |
| prefix-icon | prefix icon class | string | — | — |
| suffix-icon | suffix icon class | string | — | — |
| hide-loading | whether to hide the loading icon in remote search | boolean | — | false |
### Autocomplete Slots ### Autocomplete Slots
......
...@@ -863,6 +863,7 @@ export default { ...@@ -863,6 +863,7 @@ export default {
| label | 输入框关联的label文字 | string | — | — | | label | 输入框关联的label文字 | string | — | — |
| prefix-icon | 输入框头部图标 | string | — | — | | prefix-icon | 输入框头部图标 | string | — | — |
| suffix-icon | 输入框尾部图标 | string | — | — | | suffix-icon | 输入框尾部图标 | string | — | — |
| hide-loading | 是否隐藏远程加载时的加载图标 | boolean | — | false |
### Autocomplete Slots ### Autocomplete Slots
| name | 说明 | | name | 说明 |
......
...@@ -3,16 +3,14 @@ ...@@ -3,16 +3,14 @@
<div <div
v-show="showPopper" v-show="showPopper"
class="el-autocomplete-suggestion el-popper" class="el-autocomplete-suggestion el-popper"
:class="{ 'is-loading': parent.loading }" :class="{ 'is-loading': !parent.hideLoading && parent.loading }"
:style="{ width: dropdownWidth }" :style="{ width: dropdownWidth }"
role="region" role="region">
>
<el-scrollbar <el-scrollbar
tag="ul" tag="ul"
wrap-class="el-autocomplete-suggestion__wrap" wrap-class="el-autocomplete-suggestion__wrap"
view-class="el-autocomplete-suggestion__list" view-class="el-autocomplete-suggestion__list">
> <li v-if="!parent.hideLoading && parent.loading"><i class="el-icon-loading"></i></li>
<li v-if="parent.loading"><i class="el-icon-loading"></i></li>
<slot v-else> <slot v-else>
</slot> </slot>
</el-scrollbar> </el-scrollbar>
......
...@@ -114,7 +114,8 @@ ...@@ -114,7 +114,8 @@
placement: { placement: {
type: String, type: String,
default: 'bottom-start' default: 'bottom-start'
} },
hideLoading: Boolean
}, },
data() { data() {
return { return {
......
...@@ -56,6 +56,18 @@ export declare class ElAutocomplete extends ElementUIComponent { ...@@ -56,6 +56,18 @@ export declare class ElAutocomplete extends ElementUIComponent {
/** Whether show suggestions when input focus */ /** Whether show suggestions when input focus */
triggerOnFocus: boolean triggerOnFocus: boolean
/** Whether to emit a `select` event on enter when there is no autocomplete match */
selectWhenUnmatched: boolean
/** Prefix icon class */
prefixIcon: string
/** Suffix icon class */
suffixIcon: string
/** Whether to hide the loading icon in remote search */
hideLoading: 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