Splitting components into multiple files

So far, we have always kept our controllers separate from templates/views and styles. You may not be pleased with SFC as there are mixing concerns. To some extent, this is a matter of taste, but as components grow, it makes less and less sense to keep everything in a single file.

Actually, we can also separate the different parts of a component with Vue.js and TypeScript. We'll see how in this section.

This approach has been described by George Hanson in the following article: https://dev.to/georgehanson/building-vuejs-applications-with-typescript-1j2n. This section is directly inspired by that blog post, with George's permission.

We'll use the previous code sample as a starting point. Make a copy ...

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.