File tree Expand file tree Collapse file tree 6 files changed +9
-6
lines changed Expand file tree Collapse file tree 6 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 2828
2929 return result ;
3030 })();
31+
32+ // this line fixes an issue with es-lint and the ItenType generic
33+ type ItemType = any ;
3134 </script >
3235
3336<script lang =" ts" generics =" ItemType" >
Original file line number Diff line number Diff line change 121121 sizingCalculator ={szCalculator }
122122 onAfterScroll ={(... props ) => handleMessage (' onAfterScroll:' , props )}
123123 onVisibleRangeUpdate ={(... props ) => handleMessage (' onVisibleRangeUpdate:' , props )}>
124- {#snippet vl_slot ({ index , item , size }: VLSlotSignature )}
124+ {#snippet vl_slot ({ index , item , size }: VLSlotSignature < ( typeof myModel )[ 0 ] > )}
125125 <div
126126 style ="border: 1px solid rgb(204, 204, 204); line-height: {size }px;"
127127 class:highlighted ={index === scrollToIndex }>
Original file line number Diff line number Diff line change 77 </script >
88
99<VirtualList items ={myModel } style ="width:100%" isHorizontal ={true }>
10- {#snippet vl_slot ({ item }: VLSlotSignature )}
10+ {#snippet vl_slot ({ item }: VLSlotSignature < ( typeof myModel )[ 0 ] > )}
1111 <div style =" border: 1px solid rgb(204, 204, 204)" >
1212 {item .text }
1313 </div >
Original file line number Diff line number Diff line change 132132 {scrollToBehaviour }
133133 sizingCalculator ={szCalculator }
134134 onVisibleRangeUpdate ={handleVisualRangeChange }>
135- {#snippet vl_slot ({ index , item , size }: VLSlotSignature )}
135+ {#snippet vl_slot ({ index , item , size }: VLSlotSignature < ( typeof myModel )[ 0 ] > )}
136136 <div
137137 style ="border: 1px solid rgb(204, 204, 204); line-height: {size }px;"
138138 class:highlighted ={index === scrollToIndex }>
Original file line number Diff line number Diff line change 2424<h2 >Horizontal</h2 >
2525
2626<VirtualList items ={myModel } style ="width:100%" isHorizontal ={true } sizingCalculator ={calculator }>
27- {#snippet vl_slot ({ index , item , size }: VLSlotSignature )}
27+ {#snippet vl_slot ({ index , item , size }: VLSlotSignature < ( typeof myModel )[ 0 ] > )}
2828 <div style ="border: 1px solid rgb(204, 204, 204); width: {size }px;" >
2929 #{index }
3030 {item .text }
3535<h2 >Vertical</h2 >
3636
3737<VirtualList items ={myModel } style ="height:600px" sizingCalculator ={calculator }>
38- {#snippet vl_slot ({ index , item , size }: VLSlotSignature )}
38+ {#snippet vl_slot ({ index , item , size }: VLSlotSignature < ( typeof myModel )[ 0 ] > )}
3939 <div style ="border: 1px solid rgb(204, 204, 204); line-height: {size }px;" >
4040 #{index } Content:{item .text }
4141 </div >
Original file line number Diff line number Diff line change 77 </script >
88
99<VirtualList items ={myModel } style =" height:600px" >
10- {#snippet vl_slot ({ item }: VLSlotSignature )}
10+ {#snippet vl_slot ({ item }: VLSlotSignature < ( typeof myModel )[ 0 ] > )}
1111 <div style =" border: 1px solid rgb(204, 204, 204)" >
1212 {item .text }
1313 </div >
You can’t perform that action at this time.
0 commit comments