| 
									
										
										
										
											2018-03-01 09:19:45 -08:00
										 |  |  | {{#if props}} | 
					
						
							| 
									
										
										
										
											2018-02-25 11:20:40 -08:00
										 |  |  |   <VirtualListItem :component | 
					
						
							|  |  |  |                    :offset | 
					
						
							|  |  |  |                    :props | 
					
						
							|  |  |  |                    :key | 
					
						
							|  |  |  |                    :index | 
					
						
							| 
									
										
										
										
											2018-03-01 09:19:45 -08:00
										 |  |  |   /> | 
					
						
							|  |  |  | {{/if}} | 
					
						
							| 
									
										
										
										
											2018-01-23 18:15:14 -08:00
										 |  |  | <script> | 
					
						
							|  |  |  |   import VirtualListItem from './VirtualListItem' | 
					
						
							| 
									
										
										
										
											2018-03-14 18:24:16 -07:00
										 |  |  |   import { mark, stop } from '../../_utils/marks' | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-01-23 18:15:14 -08:00
										 |  |  |   export default { | 
					
						
							| 
									
										
										
										
											2018-03-14 18:24:16 -07:00
										 |  |  |     async oncreate() { | 
					
						
							| 
									
										
										
										
											2018-03-01 09:19:45 -08:00
										 |  |  |       // TODO: there appears to be a bug in {{#await}} that means we have to do this manually. | 
					
						
							|  |  |  |       // Some items may appear on top of other items because their offset is 0 and never updated. | 
					
						
							|  |  |  |       let makeProps = this.get('makeProps') | 
					
						
							|  |  |  |       let key = this.get('key') | 
					
						
							|  |  |  |       if (makeProps) { | 
					
						
							| 
									
										
										
										
											2018-03-14 18:24:16 -07:00
										 |  |  |         let props = await makeProps(key) | 
					
						
							| 
									
										
										
										
											2018-03-22 00:01:19 -07:00
										 |  |  |         mark('VirtualListLazyItem set props') | 
					
						
							|  |  |  |         this.set({props: props}) | 
					
						
							|  |  |  |         stop('VirtualListLazyItem set props') | 
					
						
							| 
									
										
										
										
											2018-03-01 09:19:45 -08:00
										 |  |  |       } | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2018-01-23 18:15:14 -08:00
										 |  |  |     components: { | 
					
						
							|  |  |  |       VirtualListItem | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | </script> |