mirror of
https://gitee.com/element-plus/element-plus.git
synced 2024-12-13 17:05:47 +08:00
perf(scrollbar): update bar when window resize (#1456)
This commit is contained in:
parent
2f981ab85a
commit
73b6d5492e
@ -100,12 +100,18 @@ export default defineComponent({
|
||||
onMounted(() => {
|
||||
if (props.native) return
|
||||
nextTick(update)
|
||||
!props.noresize && addResizeListener(resize.value, update)
|
||||
if (!props.noresize) {
|
||||
addResizeListener(resize.value, update)
|
||||
addEventListener('resize', update)
|
||||
}
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
if (props.native) return
|
||||
!props.noresize && removeResizeListener(resize.value, update)
|
||||
if (!props.noresize) {
|
||||
removeResizeListener(resize.value, update)
|
||||
removeEventListener('resize', update)
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user