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

Function updateChildComponent

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

Source from the content-addressed store, hash-verified

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

Callers 1

vue.runtime.jsFile · 0.70

Calls 3

validatePropFunction · 0.70
updateComponentListenersFunction · 0.70
resolveSlotsFunction · 0.70

Tested by

no test coverage detected