Subscribe on changes!

Typing: about the type of props

avatar
Nov 27th 2020

Version

3.0.3

Reproduction link

https://codesandbox.io/s/adoring-bogdan-d5phz?file=/src/App.vue

Steps to reproduce

  1. Defining the type of prop 'msg' in HelloWorld.vue.
  2. 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😥

avatar
Nov 27th 2020
avatar
Nov 27th 2020

image It seems like missing the type-checking of props?

avatar
Nov 27th 2020

VueDX requires defineComponent() for prop type checking.

avatar
Nov 27th 2020

VueDX requires defineComponent() for prop type checking.

I have used defineComponent() in my local project now, but it still don't work.

avatar
Nov 27th 2020

You can create and an issue on the VueDX repo with an example.

avatar
Nov 27th 2020

Thanks🙏🏻I will do it later. Btw, I love everything of Vue soooo much🤩So, fighting 😄😄😄

avatar
Nov 28th 2020

Closing as it's not related directly to core.