vue-comm
This project is an experiment to achieve type safety on Vue.js. The API is unstable and I cannot say that this can be used on actual applications.
Example
The following is an example of creating a counter component.
// Define prop types by using `$` helper // `$` helper has `.or`, `.optional`, `.validate` method chain // // e.g. // someProp: $(Number).or(String).optional // -> someProp: number | string | null | undefined .props // Define event handlers' type as type parameter .emits<> // `Component` decorator can receive component options object// as same as `vue-class-component`// In addition, you can inherit props and events types// by extending `Comm` that is made as above // Make a helper function for the component.// Can be used in a render function of other component.
The component helper recognize the types of props and events. That means we achieve type safe components communication.
render : Helpers
License
MIT