1.Vue生命周期:
beforeCreate
created
beforeMount
mounted
beforeUpdate
updated
beforeDestory
destoryed
分别是:创建前后,挂接前后,更新前后,销毁前后
使用:
beforecreate :loading事件
created :结束loading,初始化,实现函数自执行
mounted : 发起后端请求,拿回数据,配合路由钩子做一些事情
beforeDestory: 你确认删除XX吗?
destoryed :当前组件已被删除,清空相关内容
2.React生命周期
getDefaultProps
getInititalState
componentWillMount
render
componentDidMount
compoentWillReceiveProps
shouldComponentUpdate
conponentWillUpdtate
render
componentDidUpdtate
componentWillUnmount