Loading-pro

加载数据时显示动画。

基础用法 - 盒子内

自定义样式和背景色

showLoading、text、animation、backgroundColor、borderColor、color、width、height

全屏 loading

Show a full screen animation while loading data.

Loading Pro 样式展示

告别单调乏味的加载等待!欢迎来到 Loading Pro 的样式展示区。这里汇聚了 Loading Pro 丰富多样的视觉呈现,旨在证明一个加载组件不仅能传递“正在加载”的信息,更能成为你应用界面中一道亮丽且富有格调的风景线。

Loading Pro 样式展示

展示所有35种可爱的loading动画效果

基础样式 (1-17)

1. spinner
spinner
2. pulse
pulse
3. dots
dots
4. bounce
bounce
5. cube
cube
6. gradient
gradient
7. heartbeat
heartbeat
8. spiral
spiral
9. blink
blink
10. swing
swing
11. breath
breath
12. star
star

可爱样式 (18-35)

18. kitty
kitty
19. rainbow
rainbow
20. love
love
21. duck
duck
22. bee
bee
23. bubble
bubble
24. rocket
rocket
25. candy
candy
26. flower
flower
27. butterfly
butterfly
28. fish
fish
29. sun
sun
30. moon
moon
31. cloud
cloud
32. lightning
lightning
33. snowflake
snowflake
34. leaf
leaf
35. cherry
cherry

服务调用示例

随机样式演示

点击按钮体验随机loading效果

Loading Pro 性能展示

欢迎来到果锅的 Loading Pro 性能展示区!在这里,我们不仅仅是展示一个加载组件,更是向你证明我们对速度和效率的极致追求。你可能会好奇,一个加载组件的性能究竟有多重要?答案是:至关重要。一个卡顿、延迟的加载体验,会瞬间破坏用户对整个应用的信任感。

⚡ Loading Pro 性能展示

性能对比、最佳实践和使用建议

🏃‍♂️ 性能对比测试
No Data
💡 最佳实践建议
🚀

轻量级场景

适用于快速响应的场景,如表单提交、简单查询等

推荐: spinner, pulse, dots
🎨

用户体验优先

适用于需要提升用户体验的场景,如首页加载、重要操作等

推荐: rainbow, love, kitty, butterfly

高性能要求

适用于性能敏感的场景,如大数据表格、实时更新等

推荐: blink, breath, gradient
📱

移动端优化

适用于移动设备,考虑电池和性能限制

推荐: pulse, dots, swing
🎯 使用场景推荐
💼企业应用

专业、稳重,符合企业形象

🎮游戏应用

动感、有趣,增强游戏体验

🛒电商平台

温馨、友好,提升购物体验

📚教育平台

可爱、生动,吸引学习兴趣

🏥医疗健康

专业、关怀,符合医疗主题

🌱环保公益

自然、环保,传达绿色理念

📊 实时性能监控
当前FPS
60
内存使用
0MB
0%
活跃Loading
0
🔥 压力测试

Loading Pro 样式画廊

欢迎来到果锅的 Loading Pro 样式画廊!这里是一个精心策划的视觉空间,专门展示我们 Loading Pro 组件所能呈现的丰富多样、引人入胜的加载效果。我们深知,加载状态不仅仅是技术上的等待,更是用户体验中不可或缺的一环,它直接影响着用户对产品流畅度和专业度的感知。Show a full screen animation while loading data.

Service

You can also invoke Loading with a service. Import Loading service:

ts
import { ElLoading } from 'element-plus';

Invoke it:

ts
ElLoading.service(options);

The parameter options is the configuration of Loading, and its details can be found in the following table. LoadingService returns a Loading instance, and you can close it by invoking its close method:

ts
const loadingInstance = ElLoading.service(options);
nextTick(() => {
  // Loading should be closed asynchronously
  loadingInstance.close();
});

Note that in this case the full screen Loading is singleton. If a new full screen Loading is invoked before an existing one is closed, the existing full screen Loading instance will be returned instead of actually creating another Loading instance:

ts
const loadingInstance1 = ElLoading.service({ fullscreen: true });
const loadingInstance2 = ElLoading.service({ fullscreen: true });
console.log(loadingInstance1 === loadingInstance2); // true

Calling the close method on any one of them can close this full screen Loading.

If Element Plus is imported entirely, a globally method $loading will be registered to app.config.globalProperties. You can invoke it like this: this.$loading(options), and it also returns a Loading instance.

API

Options

NameDescriptionTypeDefault
targetthe DOM node Loading needs to cover. Accepts a DOM object or a string. If it's a string, it will be passed todocument.querySelector to get the corresponding DOM nodestring / HTMLElementdocument.body
bodysame as thebody modifier of v-loadingbooleanfalse
fullscreensame as thefullscreen modifier of v-loadingbooleantrue
locksame as thelock modifier of v-loadingbooleanfalse
textloading text that displays under the spinnerstring
spinnerclass name of the custom spinnerstring
backgroundbackground color of the maskstring
customClasscustom class name for loadingstring
svgcustom SVG element to override the default loading spinnerstring
svgViewBoxsets the viewBox attribute for loading svg elementstring
beforeClose 2.7.8Function executed before loading attempts to close. If this function returns false, the closing process will be aborted. Otherwise, the loading will close.Function
closed 2.7.8Function triggered after loading has completely closedFunction

Directives

NameDescriptionType
v-loading具体内容见下方新增Object

New Props

NameDescriptionType
showLoading是否显示 loading [仅自定义指令有效]Boolean
animation动画见下方枚举类型 Animation Enum
backgroundColor会影响动画颜色String
borderColor会影响动画颜色String
color字体颜色String
width内部动画的大小String
hegit内部动画的大小String

Animation Enum

序号名称动画名称
1弧线效果spinner
2脉冲效果pulse
3点阵效果dots
4弹跳球效果bounce
5旋转方块效果cube
6渐变环效果gradient
7心跳效果heartbeat
8螺旋效果spiral
9闪烁效果blink
10摆动效果swing
15呼吸效果breath
17星形效果star
18小猫咪效果kitty
19彩虹圈效果rainbow
20爱心跳动效果love
21小鸭子游泳效果duck
22小蜜蜂飞舞效果bee
23泡泡效果bubble
24小火箭效果rocket
25跳跳糖效果candy
26小花朵效果flower
27蝴蝶飞舞效果butterfly
28小鱼游泳效果fish
29太阳效果sun
30月亮效果moon
31云朵效果cloud
32闪电效果lightning
33雪花效果snowflake
34叶子效果leaf
35樱花效果cherry

Source

ComponentStyleDocs

Contributors