import{o as a,a as t,y as n}from"./vue-libs.b44bc779.js";const e={class:"van-doc-markdown-body"},l=n(`

Loading

Intro

Used to indicate the transition state during loading.

Install

Register component globally via app.use, refer to Component Registration for more registration ways.

import { createApp } from 'vue';
import { Loading } from 'vant';

const app = createApp();
app.use(Loading);

Usage

Type

<van-loading />

<van-loading type="spinner" />

Color

<van-loading color="#1989fa" />

<van-loading type="spinner" color="#1989fa" />

Size

<van-loading size="24" />

<van-loading type="spinner" size="24px" />

Text

<van-loading size="24px">Loading...</van-loading>

Vertical

<van-loading size="24px" vertical>Loading...</van-loading>

Text Color

use color or text-color to change text color.

<!-- the color of text and icon will be changed -->
<van-loading color="#0094ff" />

<!-- only change text color -->
<van-loading text-color="#0094ff" />

API

Props

AttributeDescriptionTypeDefault
colorLoading colorstring#c9c9c9
typeCan be set to spinnerstringcircular
sizeIcon sizenumber | string30px
text-sizeText font sizenumber | string14px
text-colorText colorstring#c9c9c9
verticalWhether to arrange icons and text content verticallybooleanfalse

Slots

NameDescription
defaultLoading text

Types

The component exports the following type definitions:

import type { LoadingType, LoadingProps } from 'vant';

Theming

CSS Variables

The component provides the following CSS variables, which can be used to customize styles. Please refer to ConfigProvider component.

NameDefault ValueDescription
--van-loading-text-colorvar(--van-text-color-2)-
--van-loading-text-font-sizevar(--van-font-size-md)-
--van-loading-spinner-colorvar(--van-gray-5)-
--van-loading-spinner-size30px-
--van-loading-spinner-animation-duration0.8s-
`,16),d=[l],h={__name:"README",setup(o,{expose:s}){return s({frontmatter:{}}),(p,r)=>(a(),t("div",e,d))}};export{h as default};