优化大屏的UI布局

This commit is contained in:
lyswhut
2022-03-11 21:36:33 +08:00
parent 377f665361
commit fc72d99ab3
7 changed files with 32 additions and 22 deletions
@@ -224,14 +224,19 @@ export default {
height: props.list.length * props.itemHeight + 'px',
}))
watch(() => props.itemHeight, updateView)
watch(() => props.list, (list) => {
const handleReset = list => {
cachedList = Array(list.length)
startIndex = -1
endIndex = -1
nextTick(() => {
updateView()
})
}
watch(() => props.itemHeight, () => {
handleReset(props.list)
})
watch(() => props.list, (list) => {
handleReset(list)
}, {
deep: true,
})