vue生命周期
<script type="text/javascript"> let v = new Vue({ el : ".ball", data : {t:1}, beforeCreate : function(){ console.log('组件刚刚被创建!') console.log(this) }, created : function(){ console.log('组件创建完成!') }, beforeMount : function(){ console.log('挂载之前!') }, mounted : function(){ console.log('挂载之后!') }, beforeDestory : function(){ console.log('组件销毁前调用!') }, beforeDestory : function(){ console.log('组件销毁后调用!') }, }) </script>