DEV Community

Discussion on: 6 essentials tips for VueJs from 2.5 years experience #1

Collapse
 
codeoz profile image
Code Oz

Thanks Charlene ! Validator is usefull since you can check if you props is 'validate' for exemple if a child component accept only the following string => 'one' or 'two' as props value, the validator will inform you that your props have an issue if you pass another value (for exemple: 'four').

You can also use validator for type checking (if you pass a number, vue will inform you that you have an issue in your code)

For more information : vuejs.org/v2/guide/components-prop...

Collapse
 
planet_cbx profile image
Charlène Bonnardeaux

Thanks for this useful l’explication ;) I going to use it in my next project followings your advices ;)