Skip to content

Prop validation support real PropType<Interface> #2343

@yoyo930021

Description

@yoyo930021
  • I have searched through existing issues

Feature Request

Now, we can't support like:

import Vue, { PropType } from 'vue'

type Bar = 'cac' | 'oao'

interface Foo {
  c: Bar
}

export default Vue.extends({
  props: {
    foo: { type: Object as PropType<Foo> },
    bar: { type: String as PropType<Bar> }
  }
})

I think we can try to analysis type recursive.
convert Foo to { c: 'cac' | 'oao' }.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions