就是页面的生命周期函数,页面从开始到销毁的过程
共有11个
创建:beforeCreate 实例创建之前,不能获取data数据
created 实例创建之后,可以获取data数据
挂载:beforeMount 组件挂载之前,可以获取data数据,不能获取dom元素
mounted 组件挂载之后,可以获取data数据,能获取dom元素
更新:beforeUpdate 数据更新,视图更新之前
updated 视图更新之后
销毁:beforeDestroy 页面销毁之前
destroyed 页面销毁之后,包括定时器、监听的销毁
组件激活:activated
组件失活:deactivated
捕获子组件的错误时调用:errorCaptured