File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed
Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change 33 import Item from " ./Item.svelte"
44 import {createEventDispatcher , onDestroy , onMount } from " svelte"
55
6- /**
7- * Unique key for getting data from `data`
8- * @type {string}
9- */
10- export let key = " id"
116 /**
127 * Source for list
138 * @type {Array<any>}
198193 })
199194
200195 function getUniqueIdFromDataSources () {
201- // return data.map((dataSource) => dataSource[key])
202196 return data .map ((dataSource , i ) => i)
203-
204197 }
205198
206199 function onItemResized (event ) {
271264 </Item >
272265 {/if }
273266 <div style ="padding: {paddingStyle }" class =" virtual-scroll-wrapper" >
274- <!-- {#each displayItems as dataItem, dataIndex (dataItem[key])} -->
275267 {#each displayItems as dataItem , dataIndex }
276268 <Item
277269 on:resize ={onItemResized }
278- uniqueKey ={dataItem [ key ] }
270+ uniqueKey ={dataIndex }
279271 horizontal ={isHorizontal }
280272 type =" item" >
281273 <slot data ={dataItem } index ={dataIndex } />
You can’t perform that action at this time.
0 commit comments