new一个vue对象开始,vue内部发生了什么
new Vue({
el: '#app',
router,
store,
components: { App },
template: '<App/>'
})
vue构造类里面init函数
-
初始化生命周期,事件,render
-
调用 beforeCreate 钩子函数
-
初始化 props、methods、data、computed 与 watch ,并且对 options 中的数据进行"响应式化"(双向绑定)以及完成依赖收集
-
调用 created 钩子函数
-
挂载组件