Posted On: Feb 22, 2018
new Vue({ data: { a: 1 }, created: function () { // `this` points to the vm instance console.log('a is: ' + this.a) } }) // => "a is: 1"
There are also other hooks which will be called at different stages of the instance’s lifecycle, for example compiled, ready and destroyed. All lifecycle hooks are called with their this context pointing to the Vue instance invoking it. Some users may have been wondering where the concept of “controllers” lives in the Vue.js world, and the answer is: there are no controllers in Vue.js. Your custom logic for a component would be split among these lifecycle hooks.
Below diagram shows complete life cycle of Vue Instance
Source: https://v1.vuejs.org/guide/instance.html#Instance-Lifecycle
Also, Read React js Interview questions
Never Miss an Articles from us.
Vue js is progressive javascript script used to create dynamic user interfaces.Vue js is very easy to learn.In order to..
Vue js comes with following features Templates Reactivity Components Transitions Routing ..
You can create Vue instance with the Vue function:var vm = new Vue({ // options }) ..