Skip to content

Table - Loading State

Display a loading overlay on the table by setting the loading property, suitable for async data request scenarios.

Basic Usage

Set the loading property to use the built-in loading effect.

Index
Name
Sex
Age
Address
1
Test1
Man
28
test abc
2
Test2
Women
22
Guangzhou
3
Test3
Man
32
Shanghai
4
Test4
Women
23
test abc
5
Test5
Women
30
Shanghai
Loading...
Basic Loading

Custom Loading Icon and Text

Pass an object to loading to customize loading text. Set { visible: true, text: '...' } to display custom text.

Index
Name
Sex
Age
Address
No Data
Loading hard...
Custom Text

Custom Loading Slot

Use the #loading slot to fully customize the loading display content.

Index
Name
Sex
Age
Address
1
Test1
Man
28
test abc
2
Test2
Women
22
Guangzhou
Custom loading animation...
Custom Slot

Async Request

In real-world scenarios, loading is typically used with async data requests. Set to true when the request starts, and false when it completes.

Index
Name
Department
Position
Salary
No Data
Async Request Loading

API

Loading Properties

The loading property supports both boolean and object forms.

UsageDescriptionType
:loading="true"Show default loading effectboolean
:loading="{ visible, text }"Object form, configurable text etc.TableLoadingConfig

TableLoadingConfig

PropertyDescriptionTypeDefault
visibleWhether to show loading statebooleanfalse
textLoading hint textstring
iconCustom loading icon componentComponent | string
backgroundOverlay background colorstringrgba(255, 255, 255, 0.8)
renderFully custom render function() => VNode

Slots

SlotDescription
loadingCustom loading display content, takes priority over loading object config

Notes

  1. Shorthand: :loading="true" is equivalent to :loading="{ visible: true }".
  2. Slot Priority: When both #loading slot and loading object config are used, slot content takes priority.
  3. Overlay Z-Index: The loading overlay z-index is 20, ensuring it covers the table content.
  4. With Requests: It's recommended to set loading = true before initiating async requests, and loading = false after completion (success or failure).

Released under the MIT License.