uniapp里的mounted_uni-app 生命周期函数执行顺序
{{message}}
点击
import {
mapState,
mapMutations
} from 'vuex';
var key = 0;
export default {
data() {
return {
message: 1
}
},
computed: {
},
methods: {
addMsg() {
this.message++
}
},
beforeCreate() {
console.group('beforeCreate 组件创建之前状态===============》');
console.log("%c%s", "color:red" , "el : " + this.$el);
console.log("%c%s", "color:red","data : " + this.$data);
console.log("%c%s", "color:red","message: " + this.message)
},
onLoad() {
console.group('onLoad 状态===============》');
console.log("%c%s", "color:red" , "el : " + this.$el);
console.log("%c%s", "color:red","data : " + this.$data);
console.log("%c%s", "color:red","message: " + this.message)
},
onShow() {
console.group('onShow 状态===============》');
console.log("%c%s", "color:red" , "el : " + this.$el);
console.log("%c%s", "color:red","data : " + this.$data);
console.log("%c%s", "color:red","message: " + this.message)
},
onReady() {
console.group('onReady 状态===============》');
console.log("%c%s", "color:red" , "el : " + this.$el);
console.log("%c%s", "color:red","data : " + this.$data);
console.log("%c%s", "color:red","message: " + this.message)
},
onUnload() {
console.group('onUnload 状态===============》');
console.log("%c%s", "color:red" , "el : " + this.$el);
console.log("%c%s", "color:red","data : " + this.$data);
console.log("%c%s", "color:red","message: " + this.message)
},
created() {
console.group('created 组件创建完毕状态===============》');
console.log("%c%s", "color:red","el : " + this.$el);
console.log("%c%s", "color:red","data : " + this.$data);
console.log("%c%s", "color:red","message: " + this.message);
},
beforeMount() {
console.group('beforeMount 组件挂载之前状态===============》');
console.log("%c%s", "color:red","el : " + (this.$el));
console.log("%c%s", "color:red","data : " + this.$data);
console.log("%c%s", "color:red","message: " + this.message);
},
mounted() {
console.group('mounted 组件挂载完毕状态===============》');
console.log("%c%s", "color:red","el : " + this.$el);
console.log(this.$el);
console.log("%c%s", "color:red","data : " + this.$data);
console.log("%c%s", "color:red","message: " + this.message);
},
beforeUpdate() {
console.group('beforeUpdate 组件更新之前状态===============》');
console.log("%c%s", "color:red","el : " + this.$el);
console.log(this.$el);
console.log("%c%s", "color:red","data : " + this.$data);
console.log("%c%s", "color:red","message: " + this.message);
},
updated() {
console.group('updated 组件更新完毕状态===============》');
console.log("%c%s", "color:red","el : " + this.$el);
console.log(this.$el);
console.log("%c%s", "color:red","data : " + this.$data);
console.log("%c%s", "color:red","message: " + this.message);
},
beforeDestroy() {
console.group('beforeDestroy 组件销毁之前状态===============》');
console.log("%c%s", "color:red","el : " + this.$el);
console.log(this.$el);
console.log("%c%s", "color:red","data : " + this.$data);
console.log("%c%s", "color:red","message: " + this.message);
},
destroyed() {
console.group('destroyed 组件销毁完毕状态===============》');
console.log("%c%s", "color:red","el : " + this.$el);
console.log(this.$el);
console.log("%c%s", "color:red","data : " + this.$data);
console.log("%c%s", "color:red","message: " + this.message)
}
}
.test-container {
width: 100%;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
box-sizing: border-box;
padding: 0upx 40upx;
button {
margin-top: 100upx;
}
}
屏幕快照 2019-07-16 上午11.11.14.png
当点击按钮时
屏幕快照 2019-07-16 上午11.24.36副本.png
总结
Page页面生命周期函数执行顺序
beforeCreate => onLoad => onShow => created => beforeMount => onReady => mounted
刷新数据后
beforeUpdate => updated
uniapp里的mounted_uni-app 生命周期函数执行顺序相关推荐
- Android生命周期函数执行顺序
转载自:http://blog.csdn.net/intheair100/article/details/39061473 程序正常启动:onCreate()->onStart()->on ...
- vue所有页面刷新一次mounted(以及所有生命周期函数)执行两次的解决方法
刚开始我发现页面每刷新一次,接口都请求两次,我以为是因为axios发送OPTIONS预检请求,但是我发现两次请求都是正常的get或者是post请求,并且只有在页面刷新的时候请求才触发两次,点击查询或者 ...
- React生命周期执行顺序详解
文章内容转载于https://www.cnblogs.com/faith3/p/9216165.html 一.组件生命周期的执行次数是什么样子的??? 只执行一次: constructor.compo ...
- Vue父子组件及mixins生命周期执行顺序
图为Vue生命周期 生命周期分别为 1. 创建前后: 在beforeCreated阶段,vue实例的挂载元素$el和数据对象Data都为undefined,还未初始化.created阶段,vue实例的 ...
- vue父子组件生命周期顺序_vue父子组件生命周期执行顺序
Parent -- Child1 -- Child2 装载 parent beforeCreate parent created parent beforeMount child1 beforeCre ...
- vue父子组件生命周期执行顺序_关于Vue组件的生命周期及执行顺序
本文主要讲述了:Vue组件渲染时的生命周期及执行顺序 Vue组件数据变更时的生命周期及执行顺序 Vue组件嵌套时的生命周期及执行顺序 正文 组件渲染时的生命周期 在组件渲染时,每个Vue组件都有4个生 ...
- 父子组件的生命周期执行顺序
父子组件的生命周期执行顺序 1.父子组件的生命周期运行顺序根据在其对应的钩子函数中的打印日志可得到如下顺序: 父beforeCreate-> 父create -> 子beforeCreat ...
- Vue组件嵌套时生命周期函数触发顺序是什么?
使用过Vue的大家,对于生命周期一定都很熟悉,在官方文档一开始,就给我们介绍了Vue的生命周期有哪些,是怎么样的顺序.这个难不倒大家. 但如果是问当组件嵌套时,父子组件的生命周期函数触发的顺序是什么样 ...
- vue父子组件生命周期执行顺序
生命周期: 一个组件从创建到销毁的整个过程就是生命周期. 生命周期函数(钩子函数): vue框架内置函数,随着组建的生命周期,自动按次序执行. beforeCreate:创建实例之前执行,元素和数据都 ...
最新文章
- java 基础---继承
- jetpack 安装
- hdu 2025:查找最大元素(水题,顺序查找)
- Java并发编程的基础-interrupt方法
- idea创建包怎么让包分层_idea创建Spring项目的方法步骤(图文)
- Rumor CodeForces - 893C(并查集)
- 今天,Java编程周末提高班(第一期)正式结束
- 创建虚拟磁盘的小工具软件plainmaker.exe
- python去干扰线_GitHub - Guardiant/VerifyCode: 验证码去干扰线识别
- php对象、面向对象
- 在哪里学python-在合肥哪里可以学Python
- 产品经理该如何做竞品分析
- 矩阵运算_如何理解矩阵对矩阵求导?
- hinkPad T510系列主要机型对比
- 离散数学真值表c语言实验报告,离散数学五人表决真值表实验报告
- php时间变时间戳,php 时间如何转换为时间戳
- XPath Extractor的使用
- UEFI应用与编程--Dump ALC662 Verb Table
- 接吻的十大忌讳及对策
- python语言画图代码_零: python matplotlib 画图进阶(含完整代码)
热门文章
- 行业盛会!2018中国人体微生物组大会
- Python计算训练数据集(测试集)中某个分类变量阴性(阳性)标签样本的不同水平(level)或者分类值的统计个数以及比例
- matplotlib可视化时间序列数据、并高亮时间序列中的指定区域(Highlight a Region of Time-Series Plot with Matplotlib)
- 广义线性模型GLM、GLMM、LMM、MLM、GMM、GEE、广义线性模型GLM和广义线性混合模型的GLMM区别
- R语言break函数和next函数实战
- python集合(set)+常见方法+交叉并补
- SQL中where与having的区别
- 基于 PacBio 测序数据的纠错算法评测与剪切位点识别研究
- tensorflow tf.keras.layers tf.image 图像增强
- 15.使用一样的BFS方法(代码几乎一模一样)解决多道LeetCode题目--542题(01矩阵)1765题(地图中的最高点)994腐烂的橘子