标签:OLE core prot com r.js let init tco try
src\platforms\web\runtime\index.js
挂载
Vue.prototype.$mount = function (
el?: string | Element,
hydrating?: boolean
): Component {
el = el && inBrowser ? query(el) : undefined
return mountComponent(this, el, hydrating)
}
src\core\instance\lifecycle.js
updateComponent = () => {
vm._update(vm._render(), hydrating)
}
//...
new Watcher(vm, updateComponent, noop, {
before () {
if (vm._isMounted) {
callHook(vm, ‘beforeUpdate‘)
}
}
}, true /* isRenderWatcher */)
src\core\instance\render.js
Vue.prototype._render = function (): VNode {
const vm: Component = this
const { render, _parentVnode } = vm.$options
//...
// set parent vnode. this allows render functions to have access
// to the data on the placeholder node.
vm.$vnode = _parentVnode
// render self
let vnode
try {
vnode = render.call(vm._renderProxy, vm.$createElement)
标签:OLE core prot com r.js let init tco try
原文地址:https://www.cnblogs.com/wenhandi/p/9870656.html