feat(select): support global size (#5590)

pull/5600/head
bqy_fe 2022-05-12 09:50:12 +08:00 committed by GitHub
parent ebc2082934
commit 40be639b63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -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,
}),