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

Function mountComponent

static/vuejs/vue.runtime.esm.js:2103–2166  ·  view source on GitHub ↗
(
  vm,
  el,
  hydrating
)

Source from the content-addressed store, hash-verified

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

Callers 1

vue.runtime.esm.jsFile · 0.70

Calls 2

callHookFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected