Optmization: Reduce redundant node rendering
This commit is contained in:
parent
60247e548c
commit
32b9757e0f
|
@ -353,7 +353,7 @@ export default {
|
||||||
let rows = rowsData.slice(animationIndex)
|
let rows = rowsData.slice(animationIndex)
|
||||||
rows.push(...rowsData.slice(0, animationIndex))
|
rows.push(...rowsData.slice(0, animationIndex))
|
||||||
|
|
||||||
this.rows = rows
|
this.rows = rows.slice(0, rowNum + 1)
|
||||||
this.heights = new Array(rowLength).fill(avgHeight)
|
this.heights = new Array(rowLength).fill(avgHeight)
|
||||||
|
|
||||||
await new Promise(resolve => setTimeout(resolve, 300))
|
await new Promise(resolve => setTimeout(resolve, 300))
|
||||||
|
@ -387,6 +387,19 @@ export default {
|
||||||
rowIndex,
|
rowIndex,
|
||||||
columnIndex: ci
|
columnIndex: ci
|
||||||
})
|
})
|
||||||
|
},
|
||||||
|
updateRows(rows, animationIndex) {
|
||||||
|
const { mergedConfig, calcRowsData, calcHeights, animationHandler, animation } = this
|
||||||
|
|
||||||
|
this.mergedConfig = {
|
||||||
|
...mergedConfig,
|
||||||
|
data: [...rows]
|
||||||
|
}
|
||||||
|
|
||||||
|
calcRowsData()
|
||||||
|
calcHeights()
|
||||||
|
if (typeof animationIndex === 'number') this.animationIndex = animationIndex
|
||||||
|
if (!animationHandler) animation(true)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
destroyed () {
|
destroyed () {
|
||||||
|
|
|
@ -208,7 +208,7 @@ export default {
|
||||||
let rows = rowsData.slice(animationIndex)
|
let rows = rowsData.slice(animationIndex)
|
||||||
rows.push(...rowsData.slice(0, animationIndex))
|
rows.push(...rowsData.slice(0, animationIndex))
|
||||||
|
|
||||||
this.rows = rows
|
this.rows = rows.slice(0, rowNum + 1)
|
||||||
this.heights = new Array(rowLength).fill(avgHeight)
|
this.heights = new Array(rowLength).fill(avgHeight)
|
||||||
|
|
||||||
await new Promise(resolve => setTimeout(resolve, 300))
|
await new Promise(resolve => setTimeout(resolve, 300))
|
||||||
|
|
Loading…
Reference in New Issue