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

[Feature Request] Hope to be able to provide PropsOptions type, or is there another way to get them? #20865

Open
okkkkkr opened this issue Jan 15, 2025 · 0 comments

Comments

@okkkkkr
Copy link

okkkkkr commented Jan 15, 2025

Problem to solve

I want to use propsFactory to get props content and use it in the genericComponent, and i will use vuetify function like makeVDividerProps. But i can't get the ts type of makeVDividerProps, i get any.

Proposed solution

Example in VDivider.tsx

export const makeVDividerProps = propsFactory({
  color: String,
  inset: Boolean,
  length: [Number, String],
  opacity: [Number, String],
  thickness: [Number, String],
  vertical: Boolean,

  ...makeComponentProps(),
  ...makeThemeProps(),
}, 'VDivider')

I hope to get the PropOption in this way

export const VDividerPropsOptions = {
  color: String,
  inset: Boolean,
  length: [Number, String],
  opacity: [Number, String],
  thickness: [Number, String],
  vertical: Boolean,

  ...makeComponentProps(),
  ...makeThemeProps(),
}

export const makeVDividerProps = propsFactory(VDividerPropsOptions, 'VDivider')

And export it in index.ts

export { VDivider, VDividerPropsOptions } from './VDivider'
Or 
export * from './VDivider'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant