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

Function mountComponent

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

Source from the content-addressed store, hash-verified

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

Callers 1

vue.esm.jsFile · 0.70

Calls 2

callHookFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected