Typing: mixin props definition not available in setup functions
Version
3.0.0
Reproduction link
https://codesandbox.io/s/confident-glade-9vqbb?file=/src/components/HelloWorld.vue
Steps to reproduce
- Have a mixin with some props definitions
- Use this mixin in a TypeScript component with a
setup
function - The props defined in the mixin are available on
this
in options API methods and onprops
object of thesetup
function. However in the second case,props
type doesn’t include the mixin props resulting in the following error:Property 'foo' does not exist on type 'Readonly<{} & { bar?: string; }>'.
What is expected?
Setup function props
should be properly typed with both component own props and mixins props.
What is actually happening?
Props definitions from mixins are not available in setup functions.
@KaelWD That’s what I thought at first, but since the value is actually available it looks more like a bad typing to me. I don't think I’ve seen another way than mixins to share props definition between components.