docs(Swipe): add lazy-render demo
This commit is contained in:
+5
-11
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user