In a similar way to React, Vue focuses mainly on components. Vue is extremely flexible in how you write and register components. You can write components as plain objects, use classes and decorators, and even JSX, to name a few.
In this chapter, you will use a common form called single file components. This is very popular, especially in Vue CLI-based projects.
Note
You can read more about the different options of writing and registering components here:https://vuejs.org/v2/guide/components-registration.htmlhttps://vuejs.org/v2/guide/render-function.htmlhttps://github.com/vuejs/vue-class-component
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...