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

defineComponent props TS error #52

Closed
Tracked by #45
productdevbook opened this issue Apr 30, 2023 · 2 comments · Fixed by #84
Closed
Tracked by #45

defineComponent props TS error #52

productdevbook opened this issue Apr 30, 2023 · 2 comments · Fixed by #84
Labels
bug Something isn't working typescript

Comments

@productdevbook
Copy link
Contributor

productdevbook commented Apr 30, 2023

There is a deficiency in the ts structure on the @oku-ui/primitive, I could not solve it.

The bellow example, I am trying to add props to the component but the the following error

image

No overload matches this call.
  Overload 1 of 5, '(setup: (props: LabelProps, ctx: { attrs: Data; slots: Readonly<InternalSlots>; emit: (event: string, ...args: any[]) => void; expose: (exposed?: Record<string, any> | undefined) => void; }) => RenderFunction | Promise<...>, options?: (Pick<...> & { ...; }) | undefined): (props: LabelProps & {}) => any', gave the following error.

runtime-core.d.ts(549, 5): The expected type comes from property 'props' which is declared here on type 'ComponentOptionsWithoutProps<LabelProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, {}, string, {}, LabelProps & {}>'
@productdevbook productdevbook added bug Something isn't working typescript labels Apr 30, 2023
@productdevbook productdevbook moved this to 📋 Backlog in oku-ui Apr 30, 2023
@johnsoncodehk
Copy link

Try this.

  props: {
    test: {
      type: String
    }
  } as never

@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in oku-ui May 4, 2023
@productdevbook
Copy link
Contributor Author

@johnsoncodehk thank you, with your help this has been resolved automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working typescript
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants