Skip to content

Commit bbfe451

Browse files
committed
fix: step type error #4908
close #4908
1 parent 5ad6649 commit bbfe451

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

components/steps/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import useBreakpoint from '../_util/hooks/useBreakpoint';
1111
import classNames from '../_util/classNames';
1212
import Progress from '../progress';
1313
import omit from '../_util/omit';
14+
import { VcStepProps } from '../vc-steps/Step';
1415

1516
export const stepsProps = () => ({
1617
prefixCls: PropTypes.string,
@@ -121,7 +122,7 @@ const Steps = defineComponent({
121122
});
122123

123124
/* istanbul ignore next */
124-
export const Step = defineComponent({ ...VcStep, name: 'AStep' });
125+
export const Step = defineComponent({ ...VcStep, name: 'AStep', props: VcStepProps() });
125126
export default Object.assign(Steps, {
126127
Step,
127128
install: (app: App) => {

components/vc-steps/Step.tsx

+26-25
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,34 @@ function isString(str: any): str is string {
77
return typeof str === 'string';
88
}
99
function noop() {}
10+
export const VcStepProps = () => ({
11+
prefixCls: PropTypes.string,
12+
wrapperStyle: PropTypes.style,
13+
itemWidth: PropTypes.string,
14+
active: PropTypes.looseBool,
15+
disabled: PropTypes.looseBool,
16+
status: PropTypes.string,
17+
iconPrefix: PropTypes.string,
18+
icon: PropTypes.any,
19+
adjustMarginRight: PropTypes.string,
20+
stepNumber: PropTypes.number,
21+
stepIndex: PropTypes.number,
22+
description: PropTypes.any,
23+
title: PropTypes.any,
24+
subTitle: PropTypes.any,
25+
progressDot: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func])),
26+
tailContent: PropTypes.any,
27+
icons: PropTypes.shape({
28+
finish: PropTypes.any,
29+
error: PropTypes.any,
30+
}).loose,
31+
onClick: PropTypes.func,
32+
onStepClick: PropTypes.func,
33+
stepIcon: PropTypes.func,
34+
});
1035
export default defineComponent({
1136
name: 'Step',
12-
props: {
13-
prefixCls: PropTypes.string,
14-
wrapperStyle: PropTypes.style,
15-
itemWidth: PropTypes.string,
16-
active: PropTypes.looseBool,
17-
disabled: PropTypes.looseBool,
18-
status: PropTypes.string,
19-
iconPrefix: PropTypes.string,
20-
icon: PropTypes.any,
21-
adjustMarginRight: PropTypes.string,
22-
stepNumber: PropTypes.number,
23-
stepIndex: PropTypes.number,
24-
description: PropTypes.any,
25-
title: PropTypes.any,
26-
subTitle: PropTypes.any,
27-
progressDot: withUndefined(PropTypes.oneOfType([PropTypes.looseBool, PropTypes.func])),
28-
tailContent: PropTypes.any,
29-
icons: PropTypes.shape({
30-
finish: PropTypes.any,
31-
error: PropTypes.any,
32-
}).loose,
33-
onClick: PropTypes.func,
34-
onStepClick: PropTypes.func,
35-
stepIcon: PropTypes.func,
36-
},
37+
props: VcStepProps(),
3738
slots: ['title', 'subTitle', 'description', 'tailContent', 'stepIcon', 'progressDot'],
3839
emits: ['click', 'stepClick'],
3940
setup(props, { slots, emit }) {

0 commit comments

Comments
 (0)