Single file components

Let's review the auto-generated App component, as shown in the following example:

<template>  <div id="app">    <img alt="Vue logo" src="./assets/logo.png">    <HelloWorld msg="Welcome to Your Vue.js App"/>  </div></template> <script>import HelloWorld from './components/HelloWorld.vue' export default {  name: 'app',  components: {    HelloWorld  }}</script> <style>#app {  font-family: 'Avenir', Helvetica, Arial, sans-serif;  -webkit-font-smoothing: antialiased;  -moz-osx-font-smoothing: grayscale;  text-align: center;  color: #2c3e50;  margin-top: 60px;}</style>

As you can see from the preceding code snippet, Vue supports using standard web constructs to compose components. Typically, single file components are written in files with a ...

Get Hands-On Full-Stack Web Development with ASP.NET Core 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.