Comments (8)
I achieved this quite simply by using flexbox. Parent style:
.parent {
display: flex;
}
and a class for the virtual scroller:
.list {
flex: 1;
}
Just need to set :remain generously.
from vue-virtual-scroll-list.
Generally speaking, this component only support fixed height for scroll offset calculation.
But there is a way by changing remain
and size
to stretch dynamic height.
from vue-virtual-scroll-list.
Hmm... Not the most convenient solution, but it works.
Thanks for your help!
from vue-virtual-scroll-list.
But there is a way by changing remain and size to stretch dynamic height.
@tangbc Do you have an example of this way of achieving this? I've tried reading the window's height programmatically and substracting the right values based on it's surrounding elements, but that's far from ideal nor does it work properly.. 😞
from vue-virtual-scroll-list.
@rijkvanzanten, here is a very simple unoptimized example: https://codesandbox.io/s/lyv8pqyl69.
Maybe @tangbc can provide a better solution, though.
from vue-virtual-scroll-list.
Ahhhhhh you use the parents height instead of the window. That makes way more sense. Thanks 🙂
I think this would be a very nice addition to have in the plugin by default if that's possible somehow. Either way, this works for me 🎉
from vue-virtual-scroll-list.
My above solution doesn't work well when trying to implement a custom scrollbar.
The problem is that Remain must be set, yet a very common use case involves using the parent's height because of responsive layouts.
from vue-virtual-scroll-list.
@ocassio your items are fixed height, what if each item has a different size, what is remain and size then?
from vue-virtual-scroll-list.
Related Issues (20)
- dynamic size error when the item have random height HOT 1
- Rendering order is incorrect when changing data-sources array HOT 1
- [Feature Request] Document scoped slot usage as alternative to `data-component` HOT 2
- [Feature Request] Provide #before and #after slots for extra customization
- Tab crashed on infinite scroll HOT 2
- 建议增加slot使用方式 HOT 1
- Typo error in live demo -> chat room file
- 建议支持skeleton加载骨架屏来代替原有的不渲染部分,这样当滚动过快时,白屏也就替换为了加载屏 HOT 2
- 我有一个好友列表(list)。因为我不确定哪个好友来信息需要增加提示(item)。于是我想通过index来快速匹配list中的item 但是我发现index是根据渲染个数输出的。怎么能更好的解决这个问题。我不想遍历这个集合。因为这个集合数据量大。
- 增加一个根据dataSources中的dataKey获取当前list索引的方法。
- 不定高度的虚拟列表 HOT 1
- Nested virtual lists
- Project maintenance status
- 低版本浏览器兼容问题 HOT 1
- 是否考虑对树形数据结构进行支持 HOT 1
- 是否有意愿增加 滚动条当前滚动到的节点 公共函数 HOT 1
- 激活285,虚拟列表追加数据后,获取高度错误
- How to Smooth scroll an item into view HOT 1
- How to "wait" for scrollToIndex to finish?
- How to get first and last visible item in the virtual list
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-virtual-scroll-list.