We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
const Child = defineComponent({ props: { label: String }, setup(_, ctx) { return () => [ <div>{_.label}</div>, <input {...ctx.attrs}/> ]; } }); const Parent = defineComponent(() => { return () => <Child label="test" placeholder="please input"/>; });
This code will show a error as following.
Type '{ label: string; placeholder: string; }' is not assignable to type 'IntrinsicAttributes & Partial<{}> & Pick<Readonly<{} & { label?: string | undefined; }> & VNodeProps & AllowedComponentProps & ComponentCustomProps, "label" | ... 9 more ... | "class">'. Property 'placeholder' does not exist on type 'IntrinsicAttributes & Partial<{}> & Pick<Readonly<{} & { label?: string | undefined; }> & VNodeProps & AllowedComponentProps & ComponentCustomProps, "label" | ... 9 more ... | "class">'
The text was updated successfully, but these errors were encountered:
You should declare type in Child component.
Child
Sorry, something went wrong.
import { defineComponent, ExtractPropTypes, HTMLAttributes } from 'vue'; const childProps = { label: String } export type ChildProps = ExtractPropTypes<typeof childProps> & HTMLAttributes const Child = defineComponent<ChildProps>({ setup(_, ctx) { return () => [ <div>{_.label}</div>, <input {...ctx.attrs}/> ]; } }); Child.props = childProps const Parent = defineComponent(() => { return () => <Child label="test" placeholder="please input"/>; });
Accepted.
No branches or pull requests
This code will show a error as following.
The text was updated successfully, but these errors were encountered: