ngulee / waterfall-layout Goto Github PK
View Code? Open in Web Editor NEW微信小程序瀑布流组件
License: MIT License
微信小程序瀑布流组件
License: MIT License
业务图片mode="widthFix" 会出现高度计算不准确的问题,猜测小程序的image mode="widthFix" 的情况下是先默认模式渲染再根据mode二次改变,所以导致第一时间获取的高度没有根据mode="widthFix"的情况获取
解决方法:waterfall-item 里面 lifetimes 的 setWaterfallItemPosition方法 在this.setData的回调里面延迟执行可以解决。
this.setData({
itemCount: itemCount + waterfall.childCount,
}, () => {
setTimeout(() => { // 这里要加延迟不然图片获取高度有问题 只是打个比方,确切来说需要图片加载完成后,再调用这个方法
this.setWaterfallItemPosition();
}, 300);
})
<view wx:if="{{isShowAllLoadedTxt}}" class="all-loaded">
应该加一下!loading判断
<view wx:if="{{!loading && isShowAllLoadedTxt}}" class="all-loaded">
btw: 感谢分享,非常棒,很好用
当图片设置为mode="widthFix" 时会出现问题,求解
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.