vue声明周期八大阶段
- created
- beforeMount
- mounted
- beforeUpdate
- updated
- beforeDestroy
- destroyed
简单说:创建——>挂载——>销毁
beforeCreate: function () {
console.log('------beforeCreate创建前状态------');
}, created: function () {
console.log('------create创建状态------');
}, beforeMount: function () {
console.log('------beforeMount建前状态------');
}, mounted: function () {
console.log('------mounted建前状态------');
}, beforeUpdate: function () {
console.log('------beorreUpdate建前状态------');
}, updated: function () {
console.log('------updated建前状态------');
}, beforeDestroy: function () {
console.log('------beforeDestroy建前状态------');
}, destroyed: function () {
console.log('------destroyed建前状态------');
},
执行结果
vue
网友评论