一、代码
<template> <view> </view> </template> <script> export default { name:"child", data() { return { }; }, props: { }, beforeCreate() { console.log('实例开始初始化'); }, created() { console.log('组件初始化完成'); }, beforeMount() { console.log('准备开始挂在页面元素'); }, mounted() { console.log('组件挂在完成'); //在下次 DOM 更新循环结束之后执行延迟回调 this.$nextTick(function(){ }) }, beforeUpdate() { console.log('数据发生变化'); }, updated() { console.log('数据渲染完成'); }, beforeDestroy() { console.log('组件开始销毁') }, destroyed() { console.log('组件已被销毁') }, methods: { } } </script> <style> </style>
标签:初始化,生命周期,console,log,app,组件,Uni From: https://www.cnblogs.com/yang-2018/p/16927700.html