virtual-list icon indicating copy to clipboard operation
virtual-list copied to clipboard

Undefined error even though passing valid array

Open ben1499 opened this issue 1 year ago • 2 comments

I'm getting the error: [Vue warn]: Error in setup: "TypeError: Cannot read properties of undefined (reading 'length')". But the options array I'm passing is valid and i haven't read the length property anywhere.

It was working initially, but after i generated new js bundle it stopped working. I'm on Vue 2.7.16 I have also installed the @vue/composition-api package during initial setup.

This is the import I'm using import VList from '@virtual-list/vue/vue2'

Code:

 <VList
    ref="list"
    :items="options"
    :first-render="10"
    item-key="index"
    class="scroller"
  >
</Vlist>

ben1499 avatar May 02 '24 06:05 ben1499

it is caused by vue2.7. Vue 2.7 support reactive like @vue/composition-api except arrays. So you need downgrade to Vue2.6 and regenrate.

phphe avatar May 02 '24 15:05 phphe

it is caused by vue2.7. Vue 2.7 support reactive like @vue/composition-api except arrays. So you need downgrade to Vue2.6 and regenrate.

Okay thanks I'll try that

ben1499 avatar May 03 '24 01:05 ben1499