VueJS part7: Lifecycle methods

Kristijan
2 min readOct 10, 2023
Vue Logo

Introduction

Recently, I started learning VueJS, and this article is part of the series of my notes while learning it. Every application and component has its lifecycle, and quite often it happens that we need to do something during some specific stage. That is why there are lifecycle methods. Functions that are executed in the specific stages of the application. In this post, I am covering which lifecycle stages of Vue are, and which methods you can use to access them.

Vue Lifecycle

Vue lifecycle diagram

beforeCreate

This method runs before anything starts in VueJS. Think of it as some action before there is an initialization object.

created

At this moment, there is an initialization object, but the template is still not compiled.

beforeMount

This stage is when your template is compiled but it is still not shown in your browser.

mounted

At this stage, the template has been compiled and shown in your browser. The moment that happens, this method gets triggered. This might be a…

--

--