1.1.5 • Published 3 years ago

vue3-waterfall-plugin v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Vue 瀑布流组件

这是一款超轻量级的瀑布流组件,无需预设高度,支持PC和移动端。

在线演示地址

演示代码地址

安装

npm i vue3-waterfall-plugin -S

使用

import Waterfall from "vue3-waterfall-plugin";
<Waterfall
  :list="list"
  :gutter="10"
  :width="240"
  :breakpoints="{
    1200: { //当屏幕宽度小于等于1200
      rowPerView: 4,
    },
    800: { //当屏幕宽度小于等于800
      rowPerView: 3,
    },
    500: { //当屏幕宽度小于等于500
      rowPerView: 2,
    }
  }"
  animationEffect="fadeInUp" // 这里默认是fadeIn,其余的效果需要自己引入animation.css之后才能使用,也可以自己写animation
  backgroundColor="rgb(73, 74, 95)"
  ref="waterfall"
  >
  <template v-slot:item="props">
    <div class="card">
      <img :src="props.data.src" alt="" @load="$refs.waterfall.refresh">
      ...
    </div>
  </template>
</Waterfall>

参数

NameTypeDefaultDescription
listArray[]列表数据
gutterNumber6卡片之间的间隙
widthNumber200卡片在PC上的宽度
breakpointsObjectbreakpoints自定义行显示个数,主要用于对移动端的适配
backgroundColorString#fff背景颜色
animationEffectStringfadeIn进入动画,默认只有fadeIn,支持引入使用animation.css的动画效果
animationDurationString1s动画时间
animationDelayString0.3s动画延迟
breakpoints: {
  1200: { //当屏幕宽度小于等于1200
    rowPerView: 4,
  },
  800: { //当屏幕宽度小于等于800
    rowPerView: 3,
  },
  500: { //当屏幕宽度小于等于500
    rowPerView: 2,
  }
}
1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago