Comments (6)
Nervermind. I just realized I missed this part in the documentation: "use computed props or watchers to properly react to props changes!".
Thank you.
from vue-virtual-scroller.
@guizoxxv I m also facing this issue after migrating to vue3.
How did you solve the issue?
from vue-virtual-scroller.
I used a computed property in the RecycleScroller
items
prop. I copied the array value using the spread operator (shallow copy was enought for me).
computed: {
list() {
return [...this.users];
},
},
Here is a demo: https://stackblitz.com/edit/vue-sq6hfb?file=src%2FApp.vue
from vue-virtual-scroller.
@guizoxxv Thanks for your reply! Shallow copying worked for me too.
But the issue you reported seems valid to me. Mutating the users array to propagate updates is what Vue recommends and the newly added user is displaying when we render the list without virtual scroller.
We should not have to create a new array like this.
from vue-virtual-scroller.
For addition, it is indeed useful, but for deletion, it does not have an effect (simple views may be effective, as shown in the above figure).
Especially for complex elements (such as nested virtual scrolling), repeated folding may occur. As shown in the above figure, due to the fact that the dom element has not been recycled, when the element is complex, it will still be displayed overlapping in the left view.
Here is a demo: https://stackblitz.com/edit/vue-qpzbjg?file=src%2FApp.vue
It can be observed in F12
that the corresponding dom was not immediately correctly reclaimed, thus still causing a bug of view overlap(The elements in the example are relatively simple and cannot be observed from the view).
from vue-virtual-scroller.
I think this issue should be reopened because there is still a possibility of errors during the deletion process (although the probability is very low)
from vue-virtual-scroller.
Related Issues (20)
- Functional sizeField for RecycleScroller's variable-size mode HOT 3
- RecycleScroller component uses gridItems mode, how to control the gap between rows and columns?
- Create an additional route to show scrolling performance without the scroller component
- Select the value and roll the paste
- About chat-domo
- account for hiding large unuse item
- Dynamic Scrollr
- Part of the content that does not fit into the container is cut off.
- RecycleScroller has all items in dom HOT 1
- When `overflow: hidden` is used, manually setting `scrollTop` or `scrollLeft` can also normally update the elements in the window.
- Error: When using<DynamicScroller>,` Events: scroll end` cannot be triggered correctly
- Issue with Nested Usage of vue-virtual-scroll Components HOT 2
- RecycleScroller: Missing rows on rapid scrollbar use HOT 2
- :data-index="index" is incorrect in DynamicScrollerItem demo
- Not reactive on items changes (splice) anymore? HOT 2
- SlotProp index of RecycleScroller is undefined HOT 1
- Where is the documentation for vue3?
- Reversed vertical scrolling and infinite scroll HOT 1
- Tooltip Hidden Behind Parent Element Due to Stacking Context with Transform & Z-index HOT 2
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-scroller.