Gathering detailed insights and metrics for publink-vue-waterfall2
Gathering detailed insights and metrics for publink-vue-waterfall2
Gathering detailed insights and metrics for publink-vue-waterfall2
Gathering detailed insights and metrics for publink-vue-waterfall2
Waterfall adaptive plugin for vue and support lazy load , so easy!
npm install publink-vue-waterfall2
Typescript
Module System
Node Version
NPM Version
Release V2.0.5
Updated on Nov 15, 2023
v2.0.0
Updated on Nov 03, 2023
v1.10.6
Updated on Nov 11, 2022
优化懒加载及加载更多 Close #109 #88 #77 #76
Updated on Sep 05, 2022
修复旧bug,新增特性 close #70 #67 #65 #62 #58 #45
Updated on Jul 31, 2020
fix: close #39 height为空监听window滚动事件,不为空则监听容器滚动
Updated on Nov 28, 2019
Vue (87.41%)
JavaScript (10.03%)
HTML (2.57%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
462 Stars
283 Commits
89 Forks
8 Watchers
26 Branches
2 Contributors
Updated on Jul 13, 2025
Latest Version
1.10.2
Package Id
publink-vue-waterfall2@1.10.2
Unpacked Size
17.66 kB
Size
5.65 kB
File Count
5
NPM Version
8.7.0
Node Version
12.17.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
3
lazy-src
)If you have some questions,welcome to describe issues、suggestions;Thank you for your Star !
Welcome to my blog !!!
Common Demo
Lazyload Demo
Code Demo
npm i
npm run dev
npm i vue-waterfall2@latest --save
Name | Default | Type | Desc |
---|---|---|---|
height | null | Number | height of container |
col | 2 | Number | The number of column |
width | null | Number | The width of each column |
gutterWidth | 10 | Number | The value of margin |
data | [] | Array | data |
isTransition | true | Boolean | load image with transition |
lazyDistance | 300 | Number | The distance of image lazy loading |
loadDistance | 300 | Number | The distance of loadmore |
For images that need to be loaded lazily, the 'lazy-src' attribute needs to be used
1<waterfall :col='col' :data="data" > 2 <template> 3 <img v-if="item.img" :lazy-src="item.img" alt="load error" /> 4 </template> 5</waterfall>
Name | Data | Desc |
---|---|---|
loadmore | - | Scroll to the bottom to trigger on PC / pull up to trigger on Mobile |
scroll | obj | Scroll to trigger and get the infomation of scroll |
finish | - | finish render |
this.$waterfall.forceUpdate() //forceUpdate
Notes:
gutterWidth
needs to be used together with width
to be effective, otherwise it will be adaptive width (when using rem
to layout, calculate the width after adaptation before passing the value).scoped
and try it1import waterfall from 'vue-waterfall2' 2Vue.use(waterfall)
1<template> 2 <div class="container-water-fall"> 3 <div><button @click="loadmore">loadmore</button> <button @click="mix">mix</button> <button @click="switchCol('5')">5列</button> <button @click="switchCol('8')">8列</button> <button @click="switchCol('10')">10列</button> </div> 4 5 <waterfall :col='col' :width="itemWidth" :gutterWidth="gutterWidth" :data="data" @loadmore="loadmore" @scroll="scroll" > 6 <template > 7 <div class="cell-item" v-for="(item,index) in data"> 8 <div class="item-body"> 9 <div class="item-desc">{{item.title}}</div> 10 <div class="item-footer"> 11 <div class="avatar" :style="{backgroundImage : `url(${item.avatar})` }"></div> 12 <div class="name">{{item.user}}</div> 13 <div class="like" :class="item.liked?'active':''" > 14 <i ></i> 15 <div class="like-total">{{item.liked}}</div> 16 </div> 17 </div> 18 </div> 19 </div> 20 </template> 21 </waterfall> 22 23 </div> 24</template> 25 26 27/* 28 notes: 29 1. attribute `gutterWidth` needs to be used together with `width` to be effective, otherwise it will be adaptive width (when using `rem` to layout, calculate the width after adaptation before passing the value). 30 2. Use the parent component of 'waterfall' if there is a problem with the style, remove CSS 'scoped' and try it 31*/ 32 33import Vue from 'vue' 34 export default{ 35 data(){ 36 return{ 37 data:[], 38 col:5, 39 } 40 }, 41 computed:{ 42 itemWidth(){ 43 return (138*0.5*(document.documentElement.clientWidth/375)) #rem to layout, Calculate the value of width 44 }, 45 gutterWidth(){ 46 return (9*0.5*(document.documentElement.clientWidth/375)) #rem to layout, Calculate the value of margin 47 } 48 }, 49 methods:{ 50 scroll(scrollData){ 51 console.log(scrollData) 52 }, 53 switchCol(col){ 54 this.col = col 55 console.log(this.col) 56 }, 57 loadmore(index){ 58 this.data = this.data.concat(this.data) 59 } 60 } 61 }
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/23 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
106 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More