diff --git a/components/list/index.tsx b/components/list/index.tsx index c3a59b2ca..cc597a43c 100644 --- a/components/list/index.tsx +++ b/components/list/index.tsx @@ -1,4 +1,4 @@ -import { provide, inject, defineComponent, App, Plugin } from 'vue'; +import { provide, inject, defineComponent, App, Plugin, ExtractPropTypes } from 'vue'; import omit from 'omit.js'; import PropTypes, { withUndefined } from '../_util/vue-types'; import classNames from '../_util/classNames'; @@ -33,6 +33,8 @@ export const ListGridType = { export const ListSize = tuple('small', 'default', 'large'); +const paginationProps = PaginationConfig(); + export const ListProps = () => ({ bordered: PropTypes.looseBool, dataSource: PropTypes.array, @@ -42,7 +44,10 @@ export const ListProps = () => ({ loading: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.object])), loadMore: PropTypes.any, pagination: withUndefined( - PropTypes.oneOfType([PropTypes.shape(PaginationConfig()).loose, PropTypes.looseBool]), + PropTypes.oneOfType([ + PropTypes.shape>>(paginationProps).loose, + PropTypes.looseBool, + ]), ), prefixCls: PropTypes.string, rowKey: PropTypes.any, diff --git a/components/table/interface.ts b/components/table/interface.ts index 59bb7a995..8e1a9fbaa 100644 --- a/components/table/interface.ts +++ b/components/table/interface.ts @@ -1,6 +1,6 @@ import { ExtractPropTypes, PropType } from 'vue'; import PropTypes, { withUndefined } from '../_util/vue-types'; -import { PaginationProps as getPaginationProps } from '../pagination'; +import { PaginationProps as getPaginationProps, PaginationConfig } from '../pagination'; import { SpinProps as getSpinProps } from '../spin'; import { Store } from './createStore'; import { tuple } from '../_util/type'; @@ -103,16 +103,15 @@ export const tableRowSelection = { export type SortOrder = 'descend' | 'ascend'; +const paginationProps = PaginationConfig(); + export const tableProps = { prefixCls: PropTypes.string, dropdownPrefixCls: PropTypes.string, rowSelection: PropTypes.oneOfType([PropTypes.shape(tableRowSelection).loose, Object]), pagination: withUndefined( PropTypes.oneOfType([ - PropTypes.shape({ - ...PaginationProps, - position: PropTypes.oneOf(tuple('top', 'bottom', 'both')), - }).loose, + PropTypes.shape>>(paginationProps).loose, PropTypes.looseBool, ]), ),