DEV Community

kim-jos
kim-jos

Posted on

Application & Component Instances

What Is the Root Component?

The root component is simply the starting point for when a Vue app is rendered. To understand this we have to know that a Vue app needs to be mounted into a DOM element for it to work and that root component is mounted to the DOM by using the mount method. We will get into more detail in the following part of the series.

What Are Component Instance Properties?

Component instance properties are data, methods, props, computed, etc. that add component options. This will be further discussed in the following part of the series but basically it is the data and methods that can be accessed in the component's template.

The word instance may confuse some people including me. To my understanding, when you use the new constructor function in JS you are creating an instance of a class or another object. If we apply that understanding in the context of Vue, each component instance would simply be a component with a parent or grandparent of the root component.

What Are Lifecycle Hooks?

Each component instance goes through a series of steps when it is created. The series of steps include being mounted, updated, and unmounted. You can add code to be applied in these specific stages.

Top comments (0)