docs(Swipe): add lazy-render demo

This commit is contained in:
chenjiahan
2020-11-30 20:45:03 +08:00
parent cafd50c9cd
commit c96a75ac38
4 changed files with 15 additions and 30 deletions
+5 -11
View File
@@ -36,25 +36,19 @@ Use `autoplay` prop to set autoplay interval.
</style>
```
### Image Lazyload
### Lazy Render
Use [Lazyload](#/en-US/lazyload) component to lazyload image.
Use `lazy-render` prop to enable lazy rendering.
```html
<van-swipe>
<van-swipe-item v-for="(image, index) in images" :key="index">
<img v-lazy="image" />
<van-swipe :autoplay="3000" lazy-render>
<van-swipe-item v-for="image in images" :key="image">
<img :src="image" />
</van-swipe-item>
</van-swipe>
```
```js
import { createApp } from 'vue';
import { Lazyload } from 'vant';
const app = createApp();
app.use(Lazyload);
export default {
data() {
return {