Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Form.Item结合useForm在TSX使用时,会报类型错误 #24

Closed
1 task
x86cloud opened this issue Nov 1, 2020 · 4 comments
Closed
1 task

Form.Item结合useForm在TSX使用时,会报类型错误 #24

x86cloud opened this issue Nov 1, 2020 · 4 comments

Comments

@x86cloud
Copy link

x86cloud commented Nov 1, 2020

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

Version

2.0.0-beta.12

Environment

vue: 3.0.2

Reproduction link

https://2x.antdv.com

Steps to reproduce

 <Form>
            <Form.Item label="用户名" required {...validateInfos.username}>
              {/* <Form.Item label="用户名" required> */}
              <Input type="text" v-slots={{ prefix: iconUser }} v-model={[modelRef.username, 'value']} />
            </Form.Item>       
     </Form>

错误信息:

 Type '{ autoLink?: boolean | undefined; required: boolean; validateStatus?: "error" | "success" | "validating" | null | undefined; help?: string | undefined; label: string; }' is not assignable to type 'IntrinsicAttributes & Partial<{ prefixCls: string; id: string; htmlFor: string; hasFeedback: boolean; autoLink: boolean; }> & Pick<Readonly<{ prefixCls: string; id: string; htmlFor: string; hasFeedback: boolean; autoLink: boolean; } & { ...; }> & VNodeProps & AllowedComponentProps & ComponentCustomProps, "label" | ....'.
  Type '{ autoLink?: boolean | undefined; required: boolean; validateStatus?: "error" | "success" | "validating" | null | undefined; help?: string | undefined; label: string; }' is not assignable to type 'Pick<Readonly<{ prefixCls: string; id: string; htmlFor: string; hasFeedback: boolean; autoLink: boolean; } & { label?: VueNode; name?: string | number | string[] | number[] | undefined; help?: VueNode; ... 11 more ...; messageVariables?: Record<...> | undefined; }> & VNodeProps & AllowedComponentProps & ComponentCus...'.
    Types of property 'validateStatus' are incompatible.
      Type '"error" | "success" | "validating" | null | undefined' is not assignable to type '"" | "error" | "success" | "warning" | "validating" | undefined'.
        Type 'null' is not assignable to type '"" | "error" | "success" | "warning" | "validating" | undefined'.
    27 |         <div class="login-box">
    28 |           <Form layout="vertical">
  > 29 |             <Form.Item label="用户名" required {...validateInfos.username}>

What is expected?

通过编译,去除错误。

What is actually happening?

Types of property 'validateStatus' are incompatible.

@tangjinzhou tangjinzhou transferred this issue from vueComponent/ant-design-vue Nov 2, 2020
@Amour1688
Copy link
Member

57b6e2f

@Amour1688
Copy link
Member

0.0.1-alpha.7

@x86cloud
Copy link
Author

x86cloud commented Nov 2, 2020

0.0.1-alpha.7

'@ant-desgin-vue/use@0.0.1-alpha.7' is not in the npm registry.

@Amour1688
Copy link
Member

再试试

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants