Components
Components are the primary way of reusing code in a Vue application. With components, you can extend HTML elements and provide additional logic to make them reusable. You can define your elements and use them in the same way as native HTML elements. As we mentioned earlier, a Vue component is also a Vue instance. It accepts the same options object during creation.
You can register a component globally so that it is available across the entire application. To do that, you can use Vue.component(id, [definition]). The first argument is component id. It is also the tag name that you will use in the template. And the second argument is definition of the component, which can be an options object or a function that will return an options ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access