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

fix(types): allow use PropType with Function #915

Merged
merged 2 commits into from
Apr 3, 2020

Conversation

pikax
Copy link
Member

@pikax pikax commented Apr 3, 2020

Allows retrieve the correct function type

{
  e: Function,
  // return type
  ee: Function as PropType<() => string>,
  // arguments + object return
  ff: Function as PropType<(a: number, b: string) => { a: boolean }>,
  // required + object return
  eee: {
    type: Function as PropType<() => { a: string }>,
    required: true
  },
  // required + arguments + object return
  fff: {
    type: Function as PropType<(a: number, b: string) => { a: boolean }>,
    required: true
  }
}

@yyx990803 yyx990803 merged commit 026eb72 into vuejs:master Apr 3, 2020
@yyx990803
Copy link
Member

Nice job!

@pikax pikax deleted the types/fix-prop-type-function branch May 6, 2020 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants