diff --git a/routes/_components/virtualList/VirtualListItem.html b/routes/_components/virtualList/VirtualListItem.html index fbe24a5..dc348a4 100644 --- a/routes/_components/virtualList/VirtualListItem.html +++ b/routes/_components/virtualList/VirtualListItem.html @@ -30,9 +30,13 @@ export default { oncreate () { let { key } = this.get() + let node = this.refs.node requestAnimationFrame(() => { + if (!node || !key) { + return + } mark('VirtualListItem gBCR') - let rect = this.refs.node.getBoundingClientRect() + let rect = node.getBoundingClientRect() stop('VirtualListItem gBCR') // update all item heights in one batch for better perf this.store.batchUpdateForRealm('itemHeights', key, rect.height)