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

Function updateChildComponent

static/vuejs/vue.runtime.common.js:2170–2223  ·  view source on GitHub ↗
(
  vm,
  propsData,
  listeners,
  parentVnode,
  renderChildren
)

Source from the content-addressed store, hash-verified

2168}
2169
2170function updateChildComponent (
2171 vm,
2172 propsData,
2173 listeners,
2174 parentVnode,
2175 renderChildren
2176) {
2177 // determine whether component has slot children
2178 // we need to do this before overwriting $options._renderChildren
2179 var hasChildren = !!(
2180 renderChildren || // has new static slots
2181 vm.$options._renderChildren || // has old static slots
2182 parentVnode.data.scopedSlots || // has new scoped slots
2183 vm.$scopedSlots !== emptyObject // has old scoped slots
2184 );
2185
2186 vm.$options._parentVnode = parentVnode;
2187 vm.$vnode = parentVnode; // update vm's placeholder node without re-render
2188 if (vm._vnode) { // update child tree's parent
2189 vm._vnode.parent = parentVnode;
2190 }
2191 vm.$options._renderChildren = renderChildren;
2192
2193 // update props
2194 if (propsData && vm.$options.props) {
2195 observerState.shouldConvert = false;
2196 if (process.env.NODE_ENV !== 'production') {
2197 observerState.isSettingProps = true;
2198 }
2199 var props = vm._props;
2200 var propKeys = vm.$options._propKeys || [];
2201 for (var i = 0; i < propKeys.length; i++) {
2202 var key = propKeys[i];
2203 props[key] = validateProp(key, vm.$options.props, propsData, vm);
2204 }
2205 observerState.shouldConvert = true;
2206 if (process.env.NODE_ENV !== 'production') {
2207 observerState.isSettingProps = false;
2208 }
2209 // keep a copy of raw propsData
2210 vm.$options.propsData = propsData;
2211 }
2212 // update listeners
2213 if (listeners) {
2214 var oldListeners = vm.$options._parentListeners;
2215 vm.$options._parentListeners = listeners;
2216 updateComponentListeners(vm, listeners, oldListeners);
2217 }
2218 // resolve slots + force update if has children
2219 if (hasChildren) {
2220 vm.$slots = resolveSlots(renderChildren, parentVnode.context);
2221 vm.$forceUpdate();
2222 }
2223}
2224
2225function isInInactiveTree (vm) {
2226 while (vm && (vm = vm.$parent)) {

Callers 1

Calls 3

validatePropFunction · 0.70
updateComponentListenersFunction · 0.70
resolveSlotsFunction · 0.70

Tested by

no test coverage detected