fix null in virtual list item (#260)
This commit is contained in:
parent
1f51cfd2eb
commit
b1a3be06ff
|
@ -30,9 +30,13 @@
|
||||||
export default {
|
export default {
|
||||||
oncreate () {
|
oncreate () {
|
||||||
let { key } = this.get()
|
let { key } = this.get()
|
||||||
|
let node = this.refs.node
|
||||||
requestAnimationFrame(() => {
|
requestAnimationFrame(() => {
|
||||||
|
if (!node || !key) {
|
||||||
|
return
|
||||||
|
}
|
||||||
mark('VirtualListItem gBCR')
|
mark('VirtualListItem gBCR')
|
||||||
let rect = this.refs.node.getBoundingClientRect()
|
let rect = node.getBoundingClientRect()
|
||||||
stop('VirtualListItem gBCR')
|
stop('VirtualListItem gBCR')
|
||||||
// update all item heights in one batch for better perf
|
// update all item heights in one batch for better perf
|
||||||
this.store.batchUpdateForRealm('itemHeights', key, rect.height)
|
this.store.batchUpdateForRealm('itemHeights', key, rect.height)
|
||||||
|
|
Loading…
Reference in New Issue