December 2017
Beginner to intermediate
376 pages
7h 53m
English
While some components are designed for use anywhere in an app, other components may be designed with a more specific purpose. When we register a component using the API, that is, Vue.component, that component is globally registered and can be used within any other component or instance.
We can also locally register a component by declaring it in the components option in the root instance, or in another component:
Vue.component('component-a', { template: ` <div> <p>Hi I'm component A</p> <component-b></component-b> </div>`, components: { 'component-b': { template: `<p>And I'm component B</p>`
} } });
Read now
Unlock full access