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>

  

posted @ 2020-01-18 20:42  cl94  阅读(87)  评论(0编辑  收藏  举报