// @ts-check to see if it identifies problems with my code. I can also start specifying types in JSdoc.
To start seeing the benefit, Daniel showed the following code snippet, and how TypeScript helps you find the error before runtime.
As you can see, TypeScript identifies the problem, that there are missing double quotes in the props.
Previously the solution to using TypeScript with Vue was to used decorators. However, this isn’t the case anymore. TypeScript has evolved a great deal, and recently shipped 2.8. Now all you need to make this Vue code TypeScript compatible is to change it from:
TypeScript is now a part of the new 3.X version of the Vue CLI, making it super simple to bake into your next project. Vetur, created by Pine Wu, is an extension which gives you Vue Tooling for VSCode. To use TypeScript in your Vue files the syntax is easy:
Vue.extendwith the object API
The best way to get started with TypeScript in your project is to just add it from the new version of the Vue CLI: