Skip to content

v-lazyImg

功能介绍

图片懒加载

示例

使用

typescript
<script setup lang="ts">
  const list = Array.from({ length: 100 }).map((_, i) => ({
    id: i,
    img: 'https://avatars.githubusercontent.com/u/65016011?v=4'
  }))
</script>
<template>
  <img
    v-for="item in list"
    :key="item.id"
    v-lazyImg="item.img"
    :style="{ width: '100px', height: '100px', display: 'block' }"
  />
</template>

Released under the MIT License.