Skip to content

Loading 加载中 ​

介绍 ​

加载图标,用于表示加载中的过渡状态。

加载类型 ​

通过 type 属性设置加载图标类型,支持 spinner flower circle ring wave sound ripple rubik bounce 九种类型,默认为 spinner。

html
<vd-loading type="flower" />

自定义颜色 ​

通过 color 属性设置加载图标颜色,默认继承父级颜色。

html
<vd-loading color="#07c160" />

自定义尺寸 ​

通过 size 属性设置加载图标尺寸,默认继承父级颜色。

html
<vd-loading size="32" />

自定义图标 ​

通过 icon 属性设置加载图标,优先级高于 type。

html
<vd-loading icon="star" />

提示文本 ​

通过 text 属性设置加载提示文本,与加载图标同行排列。

html
<vd-loading text="加载中..." />

<vd-loading type="circle">
  <template #text>加载中,请稍候</template>
</vd-loading>

铺满加载 ​

通过 fixed 属性让加载层铺满定位并居中,此时提示文本排列在图标下方。

html
<vd-loading fixed text="加载中..." />

API ​

Props ​

参数说明类型默认值
type加载类型LoadingType'spinner'
size加载图标大小string | number-
color加载图标颜色string-
icon加载图标名称,同 icon 组件IconsName-
text加载提示文本,为空时不渲染string-
fixed是否铺满定位并居中booleanfalse

代替原始 Props ​

参数说明类型默认值
custom-id根节点idstring-
custom-class根节点类名ClassValue-
custom-style根节点样式StyleValue-

Events ​

事件名说明回调参数
click点击时触发MouseEvent

Slots ​

名称说明
icon加载图标
text加载提示文本

赣ICP备2025061025号-1