From 3656dd5dbb2308d6d61985e2ab72197f7be01cef Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Thu, 19 May 2022 22:22:58 +0800 Subject: [PATCH] style: pagination --- components/pagination/Pagination.tsx | 5 ++--- .../pagination/{MiniSelect.tsx => Select.tsx} | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) rename components/pagination/{MiniSelect.tsx => Select.tsx} (51%) diff --git a/components/pagination/Pagination.tsx b/components/pagination/Pagination.tsx index be101e9f0..8201eef92 100644 --- a/components/pagination/Pagination.tsx +++ b/components/pagination/Pagination.tsx @@ -4,8 +4,7 @@ import LeftOutlined from '@ant-design/icons-vue/LeftOutlined'; import RightOutlined from '@ant-design/icons-vue/RightOutlined'; import DoubleLeftOutlined from '@ant-design/icons-vue/DoubleLeftOutlined'; import DoubleRightOutlined from '@ant-design/icons-vue/DoubleRightOutlined'; -import VcSelect from '../select'; -import MiniSelect from './MiniSelect'; +import MiniSelect, { MiddleSelect } from './Select'; import { useLocaleReceiver } from '../locale-provider/LocaleReceiver'; import VcPagination from '../vc-pagination'; import enUS from '../vc-pagination/locale/en_US'; @@ -145,7 +144,7 @@ export default defineComponent({ ...getIconsProps(prefixCls.value), prefixCls: prefixCls.value, selectPrefixCls: selectPrefixCls.value, - selectComponentClass: selectComponentClass || (isSmall ? MiniSelect : VcSelect), + selectComponentClass: selectComponentClass || (isSmall ? MiniSelect : MiddleSelect), locale: locale.value, buildOptionText, ...attrs, diff --git a/components/pagination/MiniSelect.tsx b/components/pagination/Select.tsx similarity index 51% rename from components/pagination/MiniSelect.tsx rename to components/pagination/Select.tsx index 283c9a643..132f58d9e 100644 --- a/components/pagination/MiniSelect.tsx +++ b/components/pagination/Select.tsx @@ -2,6 +2,7 @@ import { defineComponent } from 'vue'; import VcSelect, { selectProps } from '../select'; export default defineComponent({ + name: 'MiniSelect', inheritAttrs: false, props: selectProps(), 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 ; + }; + }, +});