useVirtualList with Vue2 - list is not reactive
See original GitHub issueDescribe the bug
I’m using Vue2 and useVirtualList
does not render anything. list
stays empty.
Ref #1078 (#951 Vue3)
Reproduction
https://stackblitz.com/edit/vitejs-vite-uuio2f
System Info
Stackblitz template;
{
"name": "vite-starter",
"private": true,
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview",
"postinstall": "vue-demi-fix"
},
"dependencies": {
"@vue/composition-api": "^1.4.9",
"@vueuse/components": "^7.7.1",
"@vueuse/core": "^7.7.1",
"vue": "^2.6.14",
"vue-demi": "^0.12.1"
},
"devDependencies": {
"vite": "^2.8.6",
"vite-plugin-vue2": "^1.9.3",
"vue-template-compiler": "^2.6.14"
}
}
Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a VueUse issue and not a framework-specific issue. For example, if it’s a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
useVirtualList
Create virtual lists with ease. Virtual lists (sometimes called virtual scrollers) allow you to render a large number of items performantly.
Read more >Items added to list are non-reactive in version 2 of Vue.js
If I were you, I'd create a method and just do this.items.push({ id: null, name: '' }) . There's no need to clone...
Read more >v-for performance issue · Issue #2000 · vuejs/vue
Render time in my case was reduced from 2 seconds to 100ms (aprox) ... @nkostadinov have you tried not using reactive data for...
Read more >Create a performant virtual scrolling list in Vue.js
In this article, we'll explore vue-virtual-scroll-list , an amazing library for creating virtual scroll lists in Vue.js. Let's get started!
Read more >Svelecte - select with autocomplete written in Svelte
Property Type Default
name string null
options array
valueAsObject bool false
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had to add the scroll event manually too. I’m using Vue 2.7.2.
In
<script setup>
:In
<template>
not completed