# Loading 加载

### 引入

在`index.config.js中引入组件

```json
"usingComponents": {
  "van-loading": "@vant/weapp/loading/index"
}
```

## 代码演示

### 加载类型

```html
<van-loading  type="circular" /> <van-loading type="spinner" />
```

### 自定义颜色

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

### 加载文案

```html
<van-loading size="24px"  type="circular">加载中...</van-loading>
```

### 垂直排列

```html
<van-loading size="24px"  type="circular" vertical>加载中...</van-loading>
```

## API
### 注:属性应用在组件上需要统一使用驼峰式命名，如custom-class应变为
```html
<van-button type="primary" customClass='myClass' size="large">大号按钮</van-button>
```
### 注:事件应用在组件上需要统一使用驼峰式命名，如bind:click/bind:search/bind:before-enter应变为
```html
<van-button type="primary" onClick={()=>this.onClick()}>大号按钮</van-button>
<van-search type="primary" onSearch={()=>this.onSearch()}>大号按钮</van-search>
<van-transition type="primary" onBeforeEnter={()=>this.onBeforeEnter()}>大号按钮</van-transition>
```
### Props

| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| color | 颜色 | _string_ | `#c9c9c9` | - |
| type | 类型，可选值为 `spinner` | _string_ | `circular` | - |
| size | 加载图标大小，默认单位为 `px` | _string \| number_ | `30px` | - |
| text-size | 文字大小，默认单位为为 `px` | _string \| number_ | `14px` | 1.0.0 |
| vertical | 是否垂直排列图标和文字内容 | _boolean_ | `false` | 1.0.0 |

### Slots

| 名称 | 说明     |
| ---- | -------- |
| -    | 加载文案 |

### 外部样式类

| 类名         | 说明         |
| ------------ | ------------ |
| custom-class | 根节点样式类 |
