Typing: about the type of props
Version
3.0.3
Reproduction link
https://codesandbox.io/s/adoring-bogdan-d5phz?file=/src/App.vue
Steps to reproduce
- Defining the type of prop 'msg' in HelloWorld.vue.
- Passing 123 as the prop 'msg' in App.vue.
What is expected?
I actually expect the type of prop can be hinted or warned in the parent component when I pass the props which have defined type in subComponent.
What is actually happening?
It just looks like nothing happended and working normally even I pass the different or wrong typing prop to the subComponent.
So, is there any way to let the parent component receive the type hint or warning of the subComponent's props which I have defined the type? Maybe I miss the method to make it work😥
I think that what you are looking for is https://vuejs.github.io/vetur/vti.html and https://github.com/znck/vue-developer-experience
VueDX requires
defineComponent()
for prop type checking.
I have used defineComponent() in my local project now, but it still don't work.