2018-03-01 18:19:45 +01:00
|
|
|
{{#if props}}
|
2018-01-30 04:22:28 +01:00
|
|
|
<PseudoVirtualListItem :component
|
|
|
|
:props
|
|
|
|
:key
|
|
|
|
:index
|
2018-02-04 19:05:01 +01:00
|
|
|
:length
|
2018-01-30 18:38:14 +01:00
|
|
|
:intersectionObserver
|
2018-01-31 06:17:01 +01:00
|
|
|
:isIntersecting
|
|
|
|
:isCached
|
2018-01-30 18:38:14 +01:00
|
|
|
:height
|
2018-01-30 04:22:28 +01:00
|
|
|
on:scrollToPosition
|
|
|
|
/>
|
2018-03-01 18:19:45 +01:00
|
|
|
{{/if}}
|
2018-01-30 04:22:28 +01:00
|
|
|
<script>
|
|
|
|
import PseudoVirtualListItem from './PseudoVirtualListItem.html'
|
2018-03-15 02:24:16 +01:00
|
|
|
import { mark, stop } from '../../_utils/marks'
|
|
|
|
|
2018-01-30 04:22:28 +01:00
|
|
|
export default {
|
2018-03-15 02:24:16 +01:00
|
|
|
async oncreate() {
|
2018-03-01 18:19:45 +01: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.
|
2018-04-19 18:37:05 +02:00
|
|
|
let { makeProps, key } = this.get()
|
2018-03-01 18:19:45 +01:00
|
|
|
if (makeProps) {
|
2018-03-15 02:24:16 +01:00
|
|
|
let props = await makeProps(key)
|
2018-03-22 08:01:19 +01:00
|
|
|
mark('PseudoVirtualListLazyItem set props')
|
|
|
|
this.set({props: props})
|
|
|
|
stop('PseudoVirtualListLazyItem set props')
|
2018-03-01 18:19:45 +01:00
|
|
|
}
|
|
|
|
},
|
2018-01-30 04:22:28 +01:00
|
|
|
components: {
|
|
|
|
PseudoVirtualListItem
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|