All Projects → heikaimu → vue-waterfall-plugin

heikaimu / vue-waterfall-plugin

Licence: other
vue 瀑布流插件,支持 PC 和移动端,支持 animate 的所有动画效果,支持图片懒加载

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to vue-waterfall-plugin

lazyImages
基于ES6的轻量级,高性能,简便的图片懒加载 🐈
Stars: ✭ 43 (-63.87%)
Mutual labels:  lazyload-images
icon-patterns
Include animated CSS icon patterns in your background
Stars: ✭ 15 (-87.39%)
Mutual labels:  animation-css
jekyll-loading-lazy
🧙🏽‍♀️ Automatically adds loading="lazy" to <img> and <iframe> tags. Load images on your sites lazily without JavaScript.
Stars: ✭ 41 (-65.55%)
Mutual labels:  lazyload-images
batman-css
Animation CSS
Stars: ✭ 15 (-87.39%)
Mutual labels:  animation-css
bezos-calculator
Small app that shows how much Jeff Bezos gained since the user started reading the page.
Stars: ✭ 46 (-61.34%)
Mutual labels:  animation-css
lazyload-vue
Vue Plugin for vanilla-lazyload
Stars: ✭ 29 (-75.63%)
Mutual labels:  lazyload-images
lazysimon
Minimal effort 350 byte JavaScript library to lazy load all <img> on your website
Stars: ✭ 18 (-84.87%)
Mutual labels:  lazyload-images
v-img
📸Use webp and lazyload images
Stars: ✭ 48 (-59.66%)
Mutual labels:  lazyload-images
raf-pool
requestAnimationFrame pool to avoid busyness on the thread
Stars: ✭ 16 (-86.55%)
Mutual labels:  lazyload-images
typed.css
A fully functional and flexible typewriter mixin for SCSS, with Less and Stylus support coming soon! Typed.css supports multiple strings, multi-line strings, variable speeds, per-string styling, animated caret (blinking insertion cursor), directional type-pausing, and much more. It's even accessible! ✨
Stars: ✭ 113 (-5.04%)
Mutual labels:  animation-css
rocket-lazy-load
Standalone LazyLoad plugin for WordPress (based on WP Rocket)
Stars: ✭ 25 (-78.99%)
Mutual labels:  lazyload-images
lazy-load-images.js
Progressive & lazy loading images.
Stars: ✭ 17 (-85.71%)
Mutual labels:  lazyload-images
guide-to-async-components
📖 Guide To JavaScript Async Components
Stars: ✭ 79 (-33.61%)
Mutual labels:  lazyload-images
Lazyestload.js
load images only when they are in (and remain in) the viewport
Stars: ✭ 1,455 (+1122.69%)
Mutual labels:  lazyload-images
Vanilla Lazyload
LazyLoad is a lightweight, flexible script that speeds up your website by deferring the loading of your below-the-fold images, backgrounds, videos, iframes and scripts to when they will enter the viewport. Written in plain "vanilla" JavaScript, it leverages IntersectionObserver, supports responsive images and enables native lazy loading.
Stars: ✭ 6,596 (+5442.86%)
Mutual labels:  lazyload-images
ngx-progressive-image-loader
lazy load img/picture, prevent reflow and seo friendly.
Stars: ✭ 35 (-70.59%)
Mutual labels:  lazyload-images
magento2-catalog-lazy-load
Improve the load time of your Magento 2 categories pages by loading your images on demand with our Lazy Load Extension
Stars: ✭ 56 (-52.94%)
Mutual labels:  lazyload-images
Chtcollectionviewwaterfalllayout
The waterfall (i.e., Pinterest-like) layout for UICollectionView.
Stars: ✭ 4,288 (+3503.36%)
Mutual labels:  waterfall-layout
Dev-Geeks
Open Source Project
Stars: ✭ 16 (-86.55%)
Mutual labels:  animation-css

Vue2 瀑布流组件

vue 瀑布流插件,支持 PC 和移动端,支持 animate 的所有动画效果,支持图片懒加载

在线演示地址

vue3 版本

安装

npm install vue-waterfall-plugin

使用

import { LazyImg, Waterfall } from 'vue-waterfall-plugin'
// 如果使用的vue-cli创建的项目
import 'vue-waterfall-plugin/dist/style.css'
// 如果使用的vite创建的项目
import 'vue-waterfall-plugin/style.css'
<Waterfall :list="list">
  <template #item="{ item, url, index }">
    <div class="card">
      <LazyImg :url="url" />
      <p class="text">这是内容</p>
    </div>
  </template>
</Waterfall>
data: {
  list: [
    {
      src: "xxxx.jpg",
      ...
    }
    ...
  ]
}

作用域插槽返回了3个字段: item 原始数据, url 图片资源, index 卡片索引

Props 参数

参数名 类型 默认值 描述
list Array [] 列表数据
rowKey String id 数据唯一的字段,比如列表里面的id, 如果要删除卡片,该字段为必填
imgSelector String src 图片字段选择器,如果层级较深,使用 xxx.xxx.xxx 方式
width Number 200 卡片在 PC 上的宽度
breakpoints Object breakpoints 自定义行显示个数,主要用于对移动端的适配
gutter Number 10 卡片之间的间隙
hasAroundGutter Boolean true 容器四周是否有 gutter 边距
animationPrefix String animate__animated animate.css 的动画绑定 className,默认的是 4.x.x 版本,如果想使用老版本,只需要改成 animated 即可
animationEffect String fadeIn 卡片入场动画,默认只有 fadeIn,引入 animation.css 后可使用其他动画
animationDuration Number 1000 动画执行时间(单位毫秒)
animationDelay Number 300 动画延迟(单位毫秒)
backgroundColor String #ffffff 背景颜色
loadProps Object loadProps 加载的图片和失败的图片
lazyload Boolean true 是否开启懒加载
delay Number 300 布局刷新的防抖时间,默认 300ms 内没有再次触发才刷新布局。(图片加载完成;容器大小、listwidthgutterhasAroundGutter变化时均会触发刷新)

breakpoints

breakpoints: {
  1200: { //当屏幕宽度小于等于1200
    rowPerView: 4,
  },
  800: { //当屏幕宽度小于等于800
    rowPerView: 3,
  },
  500: { //当屏幕宽度小于等于500
    rowPerView: 2,
  }
}

loadProps

import loading from 'assets/loading.png'
import error from 'assets/error.png'
loadProps: {
  loading,
  error
}

懒加载图片样式覆盖,需要将覆盖样式放在全局才能生效

.lazy__img[lazy=loading] {
  padding: 5em 0;
  width: 48px;
}

.lazy__img[lazy=loaded] {
  width: 100%;
}

.lazy__img[lazy=error] {
  padding: 5em 0;
  width: 48px;
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].