Skip to content
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

组件Steps.Step的属性类型错误 3.0.0-alpha.12 #4908

Closed
1 task
rashagu opened this issue Nov 22, 2021 · 7 comments
Closed
1 task

组件Steps.Step的属性类型错误 3.0.0-alpha.12 #4908

rashagu opened this issue Nov 22, 2021 · 7 comments
Assignees
Labels

Comments

@rashagu
Copy link

rashagu commented Nov 22, 2021

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.0.0-alpha.12

Environment

typescript 4.5.2

Reproduction link

https://github.com/*

Steps to reproduce

yarn build

What is expected?

build succsess

What is actually happening?

 - error TS2322: Type '{ key: number; subTitle: string; title: string; }' is not assignable 
to type 'IntrinsicAttributes & Partial<{ description: any; title: any; icon: any; subTitle: any; progressDot: any; tailContent: any; }> & Om
it<Readonly<Readonly<{ prefixCls?: unknown; ... 18 more ...; stepIcon?: unknown; } & { ...; } & { ...; }> & { ...; }> & { ...; } & VNodeProp
s & AllowedComponentProps & ComponentCustomPro...'.
  Type '{ key: number; subTitle: string; title: string; }' is missing the following properties from type 'Omit<Readonly<Readonly<{ prefixCls
?: unknown; wrapperStyle?: unknown; itemWidth?: unknown; active?: unknown; disabled?: unknown; status?: unknown; iconPrefix?: unknown; icon?
: unknown; adjustMarginRight?: unknown; stepNumber?: unknown; stepIndex?: unknown; description?: unknown; title?: unknown; subTitle?: unknow
n; ...': status, prefixCls, iconPrefix, itemWidth, and 3 more.

200               <Step key={index} subTitle={''} title={item.title}/>


@rashagu
Copy link
Author

rashagu commented Nov 22, 2021

 - error TS2322: Type '{ key: number; subTitle: string; title: string; }' is not assignable 
to type 'IntrinsicAttributes & Partial<{ description: any; title: any; icon: any; subTitle: any; progressDot: any; tailContent: any; }> & Om
it<Readonly<Readonly<{ prefixCls?: unknown; ... 18 more ...; stepIcon?: unknown; } & { ...; } & { ...; }> & { ...; }> & { ...; } & VNodeProp
s & AllowedComponentProps & ComponentCustomPro...'.
  Type '{ key: number; subTitle: string; title: string; }' is missing the following properties from type 'Omit<Readonly<Readonly<{ prefixCls
?: unknown; wrapperStyle?: unknown; itemWidth?: unknown; active?: unknown; disabled?: unknown; status?: unknown; iconPrefix?: unknown; icon?
: unknown; adjustMarginRight?: unknown; stepNumber?: unknown; stepIndex?: unknown; description?: unknown; title?: unknown; subTitle?: unknow
n; ...': status, prefixCls, iconPrefix, itemWidth, and 3 more.

200               <Step key={index} subTitle={''} title={item.title}/>

顺便问一下 Step 组件属性是哪里写错了?

@wubiandaxian
Copy link

补充一下:
组件Steps.Step的属性类型错误(建议老哥把此issues的标题改成这个,容易让维护者快速识别问题)

看了下源码的类型文件,发现属性类型列表多了以下“必填“属性类型:

& {
        prefixCls: string;
        status: string;
        itemWidth: string;
        iconPrefix: string;
        adjustMarginRight: string;
        stepNumber: number;
        stepIndex: number;
    } & {

导致jsx下编辑器会提示类型错误,编译的时候也会出现上面的问题

@rashagu rashagu changed the title The 3.0.0-alpha.12 version ts type error in (/ant-design-vue/lib/vc-tree/contextTypes.d.ts:62:9 ) 组件Steps.Step的属性类型错误 3.0.0-alpha.12 Nov 24, 2021
@CZDonald
Copy link

对的我也今天使用发现了类型定义问题

@rashagu
Copy link
Author

rashagu commented Nov 26, 2021

Drawer 组件 在jsx 环境下也有类似问题:提示 visible属性是必须
实际上这样就可以了:v-model={[visible.value, 'visible']}

@w20k
Copy link

w20k commented Nov 28, 2021

There is also an issue with Step type when you install it manually.

import { Step } from 'ant-design-vue'
app.use(Step);

Screenshot 2021-11-28 at 11 55 10

@tangjinzhou
Copy link
Member

you donot need use(Step). use(Steps) will auto install Step.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants