]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: comments
authorEvan You <yyx990803@gmail.com>
Thu, 20 Sep 2018 06:11:05 +0000 (02:11 -0400)
committerEvan You <yyx990803@gmail.com>
Thu, 20 Sep 2018 06:11:05 +0000 (02:11 -0400)
packages/vue/src/index.ts

index 437f31a5f7cae3522fa0caa9aad5ee126ab15e22..778d33b8e323056da9a308b42a468c4a9e673275 100644 (file)
@@ -18,8 +18,14 @@ class Vue extends Component {
       return
     }
 
+    // in compat mode, h() can take an options object and will convert it
+    // to a 3.x class-based component.
     const vnode = h(options)
+    // the component class is cached on the options object as ._normalized
     const instance = createComponentInstance(vnode, options._normalized, null)
+    // set the instance on the vnode before mounting.
+    // the mount function will skip creating a new instance if it finds an
+    // existing one.
     vnode.children = instance
 
     function mount(el: any) {