Vue lifecycle hooks

var app= new Vue({ 
el: '#app',
data:{
a: 2
}, beforeCreate
: function(){ console.log ( " Before instance creation "); }, created: function(){ console.log ( "a is:"+ this. a); console. log( " after instance creation "); }, beforeMount: function(){ console. log( " before template compilation / mounting ") }, mounted: function( ){ console.log ( " Template compilation










/ after mounting ")
},
beforeupdated: function(){
console. log( " before the instance was updated ")
},
updated: function(){
console. log( " after the instance was updated ")
},
beforeDestory: function(){
console.log ( " Called before the component is destroyed ")
},
destroyed: function(){
console.log ( " Called after the component is destroyed ")
}
})

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324821279&siteId=291194637