May 07, 2021 Vant
import Vue from 'vue';
import { Skeleton } from 'vant';
Vue.use(Skeleton);
The title placemap is displayed through the title property, and the number of placeholder paragraph lines is configured by the row property
<van-skeleton title :row="3" />
The avatar placemap is displayed through the avatar property
<van-skeleton title avatar :row="3" />
Setting the loading property to false indicates that the content is loaded, where the placemap is hidden and Skeleton's sub-components are displayed
<van-skeleton
title
avatar
:row="3"
:loading="loading"
>
<div>实际内容</div>
</van-skeleton>
export default {
data() {
return {
loading: true
}
},
mounted() {
this.loading = false;
}
};
Parameters | Description | Type | The default |
---|---|---|---|
row | The number of paragraph placemap lines | number | string |
0
|
row-width | Paragraph placemap width, you can pass an array to set the width of each line |
number |
string |
(number | string) [] |
100%
|
title | Whether to display the title placemap | boolean |
false
|
avatar | Whether to display the avatar placemap | boolean |
false
|
loading |
Whether or not the skeleton screen is displayed, the
false
content is displayed when false is passed
|
boolean |
true
|
animate | Whether to turn on the animation | boolean |
true
|
title-width | The title placemap width | number | string |
40%
|
avatar-size | The size of the avatar placemap | number | string |
32px
|
avatar-shape |
The avatar placeholder shape, with an optional value of
square
|
string |
round
|