SFC with vue-class-component

Using the officially supported vue-class-component (https://github.com/vuejs/vue-class-component) library, we can actually write Vue components using TypeScript classes, which will be more familiar to you now that we've played with Angular.

The vue-class-component library provides an @Component decorator that you can add to your classes to transform them into Vue components. For this to work, you need to set the experimentalDecorators option to true in your tsconfig.json file.

Vue components that have been written using TypeScript can be stored in files with the .vue extension. In the next section, we'll also see how we can isolate this TypeScript code by splitting Vue components into multiple files.

Here is ...

Get Learn TypeScript 3 by Building Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.