Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions components/descriptions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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);
Expand Down Expand Up @@ -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);
Expand Down