fix(descriptions): column prop number type error (#4007)

pull/4013/head
言肆 2021-04-27 22:12:47 +08:00 committed by GitHub
parent 731a58d518
commit 5eeaaae08c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -126,7 +126,7 @@ const descriptionsProps = {
extra: PropTypes.VNodeChild,
column: {
type: [Number, Object] as PropType<number | Partial<Record<Breakpoint, number>>>,
default: () => DEFAULT_COLUMN_MAP,
default: (): number | Partial<Record<Breakpoint, number>> => DEFAULT_COLUMN_MAP,
},
layout: PropTypes.oneOf(tuple('horizontal', 'vertical')),
colon: PropTypes.looseBool,
@ -135,8 +135,9 @@ const descriptionsProps = {
export type DescriptionsProps = HTMLAttributes &
Partial<ExtractPropTypes<typeof descriptionsProps>>;
const Descriptions = defineComponent<DescriptionsProps>({
const Descriptions = defineComponent({
name: 'ADescriptions',
props: descriptionsProps,
Item: DescriptionsItem,
setup(props, { slots }) {
const { getPrefixCls } = inject('configProvider', defaultConfigProvider);
@ -215,8 +216,6 @@ const Descriptions = defineComponent<DescriptionsProps>({
},
});
Descriptions.props = descriptionsProps;
Descriptions.install = function(app: App) {
app.component(Descriptions.name, Descriptions);
app.component(Descriptions.Item.name, Descriptions.Item);