fix(components): [el-table] avoid scrollbar not display (#5920)

* fix(components): [el-table] avoid scrollbar not display

* chore: optimize code
This commit is contained in:
msidolphin
2022-02-11 15:17:34 +08:00
committed by GitHub
parent dcb7365365
commit 43c41015eb
2 changed files with 18 additions and 1 deletions

View File

@@ -115,7 +115,6 @@ export default defineComponent({
const update = () => {
if (!wrap$.value) return
const offsetHeight = wrap$.value.offsetHeight - GAP
const offsetWidth = wrap$.value.offsetWidth - GAP
@@ -151,6 +150,19 @@ export default defineComponent({
{ immediate: true }
)
watch(
() => [props.maxHeight, props.height],
() => {
if (!props.native)
nextTick(() => {
update()
if (wrap$.value) {
barRef.value?.handleScroll(wrap$.value)
}
})
}
)
provide(
scrollbarContextKey,
reactive({