From d49a0e13df6f2dedeeeafaf104676785020df1dd Mon Sep 17 00:00:00 2001 From: Summer Date: Mon, 12 Jul 2021 09:19:17 +0800 Subject: [PATCH] ElDynamicSizeList: fix horizontal scrollbar bug (#2494) * ElDynamicSizeList: fix horizontal scrollbar bug * Scrollbar: delete never used var --- packages/virtual-list/src/components/scrollbar.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/virtual-list/src/components/scrollbar.ts b/packages/virtual-list/src/components/scrollbar.ts index 3898510cf3..bd3b373101 100644 --- a/packages/virtual-list/src/components/scrollbar.ts +++ b/packages/virtual-list/src/components/scrollbar.ts @@ -4,7 +4,7 @@ import { rAF, cAF } from '@element-plus/utils/raf' import isServer from '@element-plus/utils/isServer' import { NOOP } from '@vue/shared' -import { DefaultScrollBarProps, ScrollbarSizeKey, ScrollbarDirKey, SCROLLBAR_MIN_SIZE } from '../defaults' +import { DefaultScrollBarProps, SCROLLBAR_MIN_SIZE, HORIZONTAL } from '../defaults' import { renderThumbStyle } from '../utils' import { BAR_MAP } from '../../../scrollbar/src/util' @@ -36,11 +36,10 @@ const ScrollBar = defineComponent({ const trackStyle = computed(() => ({ display: props.visible ? null : 'none', position: 'absolute', - [ScrollbarSizeKey[props.layout]]: '6px', - [ScrollbarDirKey[props.layout]]: '2px', + width: HORIZONTAL === props.layout ? '100%' : '6px', + height: HORIZONTAL === props.layout ? '6px' : '100%', right: '2px', bottom: '2px', - height: '100%', borderRadius: '4px', }))