Skip to content

Conversation

@pikax
Copy link
Member

@pikax pikax commented Jun 7, 2020

fix #291

Gets the correct type for the prop

Similar to #301

interface A {
  a: String
}

defineComponent({
  props: {
    a: Object as PropType<A>
  },
  setup(props){
    props.a 
  }
})

Copy link
Member

@antfu antfu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, that's quick! Confirmed working.

@antfu
Copy link
Member

antfu commented Jun 7, 2020

I have double-checked the code and I think it's alright, let's ship it with v0.6.0!

@antfu antfu merged commit 387f484 into vuejs:master Jun 7, 2020
antfu added a commit that referenced this pull request Jun 7, 2020
sapphi-red added a commit to sapphi-red/composition-api that referenced this pull request Jun 11, 2020
antfu pushed a commit that referenced this pull request Jun 12, 2020
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.

Typescript: 'Function' type of PropType introduced in 0.5.0 is annoying when using Vetur

2 participants