213 ms·
> lets you write templates with HTML attributes that's somewhat bothersome... does it typecheck on compile time? hope vue works on typescript-language-specs co
by devdoomari 9y ago
> lets you write templates with HTML attributes
that's somewhat bothersome... does it typecheck on compile time? hope vue works on typescript-language-specs compliant plugin...
As for react, there's TSX (typescript-jsx) that works great (typechecks on props, state, etc.), but I haven't tried it with vue.
- yunyu 9y agoIf you use single file components, there are some common compile time checks by default for the render function, but I'd argue that type checks are not as necessary as in JSX (which you can use with full type checking in Vue) due to separation being encouraged. Type checking for props and state inside the <script> tags is fully supported: https://vuejs.org/v2/guide/typescript.html https://vuejs.org/v2/guide/typescript.html If you want type checks for inline <template> code (which isn't suitable for anything non-trivial, you should use computed properties or methods instead), see https://github.com/DanielRosenwasser/typescript-vue-tutorial https://github.com/DanielRosenwasser/typescript-vue-tutorial If you are using uncompiled components (newbies using script embeds) with no build step at all, there are clearly no compile time checks. IMO this is why Vue is significantly more newbie friendly.