style: pagination

pull/5820/head
tangjinzhou 2022-05-19 22:22:58 +08:00
parent 7b60f2a8e6
commit 3656dd5dbb
2 changed files with 20 additions and 3 deletions

View File

@ -4,8 +4,7 @@ import LeftOutlined from '@ant-design/icons-vue/LeftOutlined';
import RightOutlined from '@ant-design/icons-vue/RightOutlined'; import RightOutlined from '@ant-design/icons-vue/RightOutlined';
import DoubleLeftOutlined from '@ant-design/icons-vue/DoubleLeftOutlined'; import DoubleLeftOutlined from '@ant-design/icons-vue/DoubleLeftOutlined';
import DoubleRightOutlined from '@ant-design/icons-vue/DoubleRightOutlined'; import DoubleRightOutlined from '@ant-design/icons-vue/DoubleRightOutlined';
import VcSelect from '../select'; import MiniSelect, { MiddleSelect } from './Select';
import MiniSelect from './MiniSelect';
import { useLocaleReceiver } from '../locale-provider/LocaleReceiver'; import { useLocaleReceiver } from '../locale-provider/LocaleReceiver';
import VcPagination from '../vc-pagination'; import VcPagination from '../vc-pagination';
import enUS from '../vc-pagination/locale/en_US'; import enUS from '../vc-pagination/locale/en_US';
@ -145,7 +144,7 @@ export default defineComponent({
...getIconsProps(prefixCls.value), ...getIconsProps(prefixCls.value),
prefixCls: prefixCls.value, prefixCls: prefixCls.value,
selectPrefixCls: selectPrefixCls.value, selectPrefixCls: selectPrefixCls.value,
selectComponentClass: selectComponentClass || (isSmall ? MiniSelect : VcSelect), selectComponentClass: selectComponentClass || (isSmall ? MiniSelect : MiddleSelect),
locale: locale.value, locale: locale.value,
buildOptionText, buildOptionText,
...attrs, ...attrs,

View File

@ -2,6 +2,7 @@ import { defineComponent } from 'vue';
import VcSelect, { selectProps } from '../select'; import VcSelect, { selectProps } from '../select';
export default defineComponent({ export default defineComponent({
name: 'MiniSelect',
inheritAttrs: false, inheritAttrs: false,
props: selectProps(), props: selectProps(),
Option: VcSelect.Option, Option: VcSelect.Option,
@ -16,3 +17,20 @@ export default defineComponent({
}; };
}, },
}); });
export const MiddleSelect = defineComponent({
name: 'MiddleSelect',
inheritAttrs: false,
props: selectProps(),
Option: VcSelect.Option,
setup(props, { attrs, slots }) {
return () => {
const selelctProps: any = {
...props,
size: 'middle',
...attrs,
};
return <VcSelect {...selelctProps} v-slots={slots}></VcSelect>;
};
},
});