| 6264 | |
| 6265 | //调用VueComponent构造函数去实例化组件对象 |
| 6266 | function createComponentInstanceForVnode( |
| 6267 | vnode, // we know it's MountedComponentVNode but flow doesn't //我们知道它是MountedComponentVNode,但flow不是 |
| 6268 | parent, // activeInstance in lifecycle state 处于生命周期状态的activeInstance |
| 6269 | parentElm, // 父亲dom |
| 6270 | refElm //当前的dom |
| 6271 | ) { |
| 6272 | var options = { |
| 6273 | _isComponent: true, //是否是组件 |
| 6274 | parent: parent, //组件的父节点 |
| 6275 | _parentVnode: vnode, //组件的 虚拟vonde 父节点 |
| 6276 | _parentElm: parentElm || null, //父节点的dom el |
| 6277 | _refElm: refElm || null //当前节点 el |
| 6278 | }; |
| 6279 | // check inline-template render functions 检查内联模板渲染函数 |
| 6280 | var inlineTemplate = vnode.data.inlineTemplate; //内联模板 |
| 6281 | if (isDef(inlineTemplate)) { //是否有内联模板 |
| 6282 | options.render = inlineTemplate.render; //如果有内联模板 获取内联模板的渲染函数 |
| 6283 | options.staticRenderFns = inlineTemplate.staticRenderFns; //获取静态渲染函数 |
| 6284 | } |
| 6285 | return new vnode.componentOptions.Ctor(options) //实例化 VueComponent 构造函数 |
| 6286 | } |
| 6287 | |
| 6288 | //安装组件钩子函数 |
| 6289 | function installComponentHooks( |