Vue声明周期
2017-11-27 12:02:13 0 举报
Vue声明周期
作者其他创作
大纲/内容
组件1
布局组件
普通组件
patch.js l109 createElm
Vue父子组件单向数据流
create render function
vm.$mount(el)
Has \"el\" option
patch
render
组件4
YES
new Vue({ el:\"#demo\
destroyed
Has \"template\" option
Destroyed
组件2
NO
beforeMount
created
Compile el's outHTML intoas template
callHook mounted
Compile template intorender function
Mounted
new Vue()
callHook beforeMount
Init Events
get \"options.render\"
组件3
mounted
1阶段——render
2阶段——patch
http://www.processon.com
Create vm.$eland replace \"el\" with it
create-element.js l26 createElement
updateComponent
slot
Has \"options.render\"
beforeDestory
$mount()
beforeCreate
处理 el
Observe Data
0 条评论
下一页