fix: step type error #4908

close #4908
pull/4940/head
tangjinzhou 2021-11-26 21:48:35 +08:00
parent 5ad66497e5
commit bbfe451d5e
2 changed files with 28 additions and 26 deletions

View File

@ -11,6 +11,7 @@ import useBreakpoint from '../_util/hooks/useBreakpoint';
import classNames from '../_util/classNames'; import classNames from '../_util/classNames';
import Progress from '../progress'; import Progress from '../progress';
import omit from '../_util/omit'; import omit from '../_util/omit';
import { VcStepProps } from '../vc-steps/Step';
export const stepsProps = () => ({ export const stepsProps = () => ({
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
@ -121,7 +122,7 @@ const Steps = defineComponent({
}); });
/* istanbul ignore next */ /* istanbul ignore next */
export const Step = defineComponent({ ...VcStep, name: 'AStep' }); export const Step = defineComponent({ ...VcStep, name: 'AStep', props: VcStepProps() });
export default Object.assign(Steps, { export default Object.assign(Steps, {
Step, Step,
install: (app: App) => { install: (app: App) => {

View File

@ -7,9 +7,7 @@ function isString(str: any): str is string {
return typeof str === 'string'; return typeof str === 'string';
} }
function noop() {} function noop() {}
export default defineComponent({ export const VcStepProps = () => ({
name: 'Step',
props: {
prefixCls: PropTypes.string, prefixCls: PropTypes.string,
wrapperStyle: PropTypes.style, wrapperStyle: PropTypes.style,
itemWidth: PropTypes.string, itemWidth: PropTypes.string,
@ -33,7 +31,10 @@ export default defineComponent({
onClick: PropTypes.func, onClick: PropTypes.func,
onStepClick: PropTypes.func, onStepClick: PropTypes.func,
stepIcon: PropTypes.func, stepIcon: PropTypes.func,
}, });
export default defineComponent({
name: 'Step',
props: VcStepProps(),
slots: ['title', 'subTitle', 'description', 'tailContent', 'stepIcon', 'progressDot'], slots: ['title', 'subTitle', 'description', 'tailContent', 'stepIcon', 'progressDot'],
emits: ['click', 'stepClick'], emits: ['click', 'stepClick'],
setup(props, { slots, emit }) { setup(props, { slots, emit }) {