( vm, el, hydrating )
| 2103 | } |
| 2104 | |
| 2105 | function mountComponent ( |
| 2106 | vm, |
| 2107 | el, |
| 2108 | hydrating |
| 2109 | ) { |
| 2110 | vm.$el = el; |
| 2111 | if (!vm.$options.render) { |
| 2112 | vm.$options.render = createEmptyVNode; |
| 2113 | if (process.env.NODE_ENV !== 'production') { |
| 2114 | /* istanbul ignore if */ |
| 2115 | if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') || |
| 2116 | vm.$options.el || el) { |
| 2117 | warn( |
| 2118 | 'You are using the runtime-only build of Vue where the template ' + |
| 2119 | 'compiler is not available. Either pre-compile the templates into ' + |
| 2120 | 'render functions, or use the compiler-included build.', |
| 2121 | vm |
| 2122 | ); |
| 2123 | } else { |
| 2124 | warn( |
| 2125 | 'Failed to mount component: template or render function not defined.', |
| 2126 | vm |
| 2127 | ); |
| 2128 | } |
| 2129 | } |
| 2130 | } |
| 2131 | callHook(vm, 'beforeMount'); |
| 2132 | |
| 2133 | var updateComponent; |
| 2134 | /* istanbul ignore if */ |
| 2135 | if (process.env.NODE_ENV !== 'production' && config.performance && mark) { |
| 2136 | updateComponent = function () { |
| 2137 | var name = vm._name; |
| 2138 | var id = vm._uid; |
| 2139 | var startTag = "vue-perf-start:" + id; |
| 2140 | var endTag = "vue-perf-end:" + id; |
| 2141 | |
| 2142 | mark(startTag); |
| 2143 | var vnode = vm._render(); |
| 2144 | mark(endTag); |
| 2145 | measure((name + " render"), startTag, endTag); |
| 2146 | |
| 2147 | mark(startTag); |
| 2148 | vm._update(vnode, hydrating); |
| 2149 | mark(endTag); |
| 2150 | measure((name + " patch"), startTag, endTag); |
| 2151 | }; |
| 2152 | } else { |
| 2153 | updateComponent = function () { |
| 2154 | vm._update(vm._render(), hydrating); |
| 2155 | }; |
| 2156 | } |
| 2157 | |
| 2158 | vm._watcher = new Watcher(vm, updateComponent, noop); |
| 2159 | hydrating = false; |
| 2160 | |
| 2161 | // manually mounted instance, call mounted on self |
| 2162 | // mounted is called for render-created child components in its inserted hook |
no test coverage detected