We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// 伪代码
let uid = 0 Vue.prototype._init = function(options) { const vm = this // vm._uid = uid++ // a flag to avoid this being observed vm._isVue = true // merge options if (options && options._isComponent) { } // if (dev) { initProxy(vm) } else { // 含义? vm._renderProxy = vm } vm._self = vm // 初始化生命周期 // $parent $root $children $refs // _watcher _inactive _directInactive // _isMounted _isDestroyed _isBeingDestroyed initLifecycle(vm) // 绑定事件 // 为什么是 init parent attached events // 即 vm.$options._parentListeners initEvents(vm) // $slots $scopedSlots // _c $createElement // 绑定attrs和listeners initRender(vm) // 在调用生命周期钩子时,是可以调用多次 // handlers[i].call(vm) callHook(vm, 'beforeCreate') // initInjections(vm) // 初始化props、data、methods、computed // 如果定义了watch,也初始化watch // 其中有observe(value) initState(vm) // callHook(vm, 'created') // 如果el存在 vm.$mount(vm.$options.el) }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
// 伪代码
The text was updated successfully, but these errors were encountered: