From 40be639b63becf119841bd54cb82759918f41375 Mon Sep 17 00:00:00 2001 From: bqy_fe <1743369777@qq.com> Date: Thu, 12 May 2022 09:50:12 +0800 Subject: [PATCH] feat(select): support global size (#5590) --- components/select/index.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/select/index.tsx b/components/select/index.tsx index 99e450f31..4275c5413 100644 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -106,15 +106,18 @@ const Select = defineComponent({ return mode; }); - const { prefixCls, direction, configProvider, getPrefixCls } = useConfigInject('select', props); + const { prefixCls, direction, configProvider, size, getPrefixCls } = useConfigInject( + 'select', + props, + ); const rootPrefixCls = computed(() => getPrefixCls()); const transitionName = computed(() => getTransitionName(rootPrefixCls.value, 'slide-up', props.transitionName), ); const mergedClassName = computed(() => classNames({ - [`${prefixCls.value}-lg`]: props.size === 'large', - [`${prefixCls.value}-sm`]: props.size === 'small', + [`${prefixCls.value}-lg`]: size.value === 'large', + [`${prefixCls.value}-sm`]: size.value === 'small', [`${prefixCls.value}-rtl`]: direction.value === 'rtl', [`${prefixCls.value}-borderless`]: !props.bordered, }),