Skip to content

Support TypeScript Prop types #413

@sem4phor

Description

@sem4phor

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions