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

Function mountComponent

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

Source from the content-addressed store, hash-verified

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

Callers 1

vue.common.jsFile · 0.70

Calls 2

callHookFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected