From 9e34ea5e5472c878952f81cc0a7af38c1c5ca751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=A5=E6=99=93=E5=90=8C=E4=B8=B6?= <947803089@qq.com> Date: Sat, 23 Dec 2023 16:48:08 +0800 Subject: [PATCH] feat(components): [autocomplete] add `loading` slot (#15206) * feat(components): [autocomplete] add `loading` slot * chore: Update autocomplete.md * docs(components): [autocomplete] modify loading slot description * Update docs/en-US/component/autocomplete.md Co-authored-by: btea <2356281422@qq.com> * Update docs/en-US/component/autocomplete.md --------- Co-authored-by: zhixiaotong Co-authored-by: btea <2356281422@qq.com> --- docs/en-US/component/autocomplete.md | 25 ++- docs/examples/autocomplete/custom-loading.vue | 165 ++++++++++++++++++ .../autocomplete/src/autocomplete.vue | 8 +- 3 files changed, 188 insertions(+), 10 deletions(-) create mode 100644 docs/examples/autocomplete/custom-loading.vue diff --git a/docs/en-US/component/autocomplete.md b/docs/en-US/component/autocomplete.md index 85bddf30b2..12cb0aa98e 100644 --- a/docs/en-US/component/autocomplete.md +++ b/docs/en-US/component/autocomplete.md @@ -43,6 +43,16 @@ autocomplete/remote-search ::: +## Custom Loading ^(2.5.0) + +Override loading content. + +:::demo + +autocomplete/custom-loading + +::: + ## API ### Attributes @@ -77,13 +87,14 @@ autocomplete/remote-search ### Slots -| Name | Description | Type | -| ------- | ------------------------------------ | ---------------------------------------- | -| default | custom content for input suggestions | ^[object]`{ item: Record }` | -| prefix | content as Input prefix | - | -| suffix | content as Input suffix | - | -| prepend | content to prepend before Input | - | -| append | content to append after Input | - | +| Name | Description | Type | +| ---------------- | ------------------------------------ | ---------------------------------------- | +| default | custom content for input suggestions | ^[object]`{ item: Record }` | +| prefix | content as Input prefix | - | +| suffix | content as Input suffix | - | +| prepend | content to prepend before Input | - | +| append | content to append after Input | - | +| loading ^(2.5.0) | override loading content | - | ### Exposes diff --git a/docs/examples/autocomplete/custom-loading.vue b/docs/examples/autocomplete/custom-loading.vue new file mode 100644 index 0000000000..b35c45c7c4 --- /dev/null +++ b/docs/examples/autocomplete/custom-loading.vue @@ -0,0 +1,165 @@ + + + + + diff --git a/packages/components/autocomplete/src/autocomplete.vue b/packages/components/autocomplete/src/autocomplete.vue index 8f383c85b3..8abb59d18d 100644 --- a/packages/components/autocomplete/src/autocomplete.vue +++ b/packages/components/autocomplete/src/autocomplete.vue @@ -77,9 +77,11 @@ role="listbox" >
  • - - - + + + + +