2019-05-03 09:37:24 +08:00

63 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## Skeleton
### Install
``` javascript
import { Skeleton } from 'vant';
Vue.use(Skeleton);
```
### Usage
#### Basic Usage
```html
<van-skeleton title :row="3" />
```
#### Show Avatar
```html
<van-skeleton title avatar :row="3" />
```
#### Show Children
```html
<van-skeleton
title
avatar
:row="3"
:loading="loading"
>
<div>Content</div>
</van-skeleton>
```
```js
export default {
data() {
return {
loading: true
}
},
mounted() {
this.loading = false;
}
};
```
### Props
| Attribute | Description | Type | Default |
|------|------|------|------|
| row | Row count | `Number` | `0` |
| row-width | Row width, can be array | `Number | String | Array` | `100%` |
| title | Whether to show title placeholder | `Boolean` | `false` |
| title-width | Title width | `Number | String` | `40%` |
| avatar | Whether to show avatar placeholder | `Boolean` | `false` |
| avatar-size | Size of avatar placeholder | `Number | String` | `32px` |
| avatar-shape | Shape of avatar placeholdercan be set to `square` | `String` | `round` |
| loading | Whether to show skeletonpass `false` to show child component | `Boolean` | `true` |
| animate | Whether to enable animation | `Boolean` | `true` |