MCPcopy Create free account
hub / github.com/TruthHun/BookStack / mountComponent

Function mountComponent

static/vuejs/vue.js:2113–2176  ·  view source on GitHub ↗
(
  vm,
  el,
  hydrating
)

Source from the content-addressed store, hash-verified

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

Callers 1

vue.jsFile · 0.70

Calls 2

callHookFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected