加载图标,用于表示加载中的过渡状态。
import { Loading } from "@taroify/core"
通过 type 属性可以设置加载图标的类型,默认为 circular,可选值为 spinner。
type
circular
spinner
<Loading /> <Loading type="spinner" />
通过 css 设置加载图标的颜色。
css
.custom-color { color: #1989fa; .taroify-loading__text { color: #1989fa; } }
通过 size 属性设置加载图标的大小,默认单位为 px。
size
px
<Loading size="24px" /> <Loading type="spinner" size="24px" />
可以使用默认插槽在图标的右侧插入加载文案。
<Loading size="24px">加载中...</Loading>
设置 vertical 属性后,图标和文案会垂直排列。
vertical
<Loading size="24px" direction="vertical">加载中...</Loading>