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

Support TypeScript Prop types #413

Closed
sem4phor opened this issue May 14, 2019 · 0 comments
Closed

Support TypeScript Prop types #413

sem4phor opened this issue May 14, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@sem4phor
Copy link

The problem

Since this PR is merged Vue supports prop declaration with typescript types (Without using the class-based syntax). for example:

interface SelectOption {
  label: string;
  value: string | number;
}

export default Vue.extend({
  props: {
    value: {
      type: [String, Number] as Prop<SelectOption['value']>,
      default: undefined
    }
...

The vue-docgen-parser returns undefined in this case resulting in types being not documented in the generated styleguide.

Proposed solution

Extend the parser to support the Typescript prop types when using the Vue.extend syntax.

@elevatebart elevatebart added enhancement New feature or request vue-docgen-api labels May 14, 2019
@elevatebart elevatebart changed the title Support TypeScript PropTypes Support TypeScript Prop types Jun 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants