export default {
// ...
// 在组件初始化时调用,可以简单理解为页面加载时
created () {
// 存在 localStorage 的缓存内容
if (localStorage.data) {
this.myData = JSON.parse(localStorage.data)
}
else {
// 页面无缓存内容时,初始化数据并写入缓存
this.initData()
}
}
// 在组件销毁前调用,但这并不能监听到页面退出的事件
beforeDestory () {
// 在此同样可对 localStorage 做一些处理
}
}
export default {
beforecreate() {
// 创建前状态
}
created () {
// 创建完毕状态
}
beforeMount(){
// 挂载前状态
}
mounted(){
// 挂载结束状态
}
}
 

最新文章

  1. Angular遇上CoffeeScript - NgComponent封装
  2. Oracle12c IMO 测试
  3. sdut 2610:Boring Counting(第四届山东省省赛原题,划分树 + 二分)
  4. Interview-Harry Potter walk through matrix.
  5. Exceptionin thread "main" java.lang.UnsatisfiedLinkError:org.apache.hadoop.util.NativeCrc32.nativeComputeChunkedSumsByteArray(II[BI[BIILjav
  6. cookie管理中的一些细节,转的
  7. 第二章 LM3S USB处理器
  8. Dev控件用法 aspxTreeList 无刷新 aspxGridView 数据
  9. android核心服务初探
  10. Sql Server根据表名获得所有列及其属性
  11. EF的两种延迟加载
  12. 【NOIP2011提高组】选择客栈
  13. 2018.3.29 DIV位置调整代码
  14. python并发_进程_multiprocessing
  15. 2018.5.4 Unix的五种IO模型
  16. BP算法基本原理推导----《机器学习》笔记
  17. Python之随机梯度下降
  18. Keepalived基础知识-运维小结
  19. 2014年蓝桥杯省赛A组c++第3题(数组构造+暴力求解)
  20. MySql连接时出现1251 client does no support authentic错误解决方法

热门文章

  1. Codeforces 975D. Ghosts
  2. JavaScirpt(JS)——BOM浏览器对象模型
  3. 洛谷P1970 花匠(dp)
  4. Nodejs 如何制作命令行工具
  5. Zepto和Jquery区别
  6. toMapFromStage layerDefinitions ClassBreakRenderer
  7. Python数组使用
  8. Picklist的配置
  9. The content of element type "bean" must match "(description?,(constructor-arg|property|lookup-method|replaced-method)*)".
  10. IT人们给个建议