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

Function loop

static/vuejs/vue.common.js:2684–2715  ·  view source on GitHub ↗
( key )

Source from the content-addressed store, hash-verified

2682 // root instance props should be converted
2683 observerState.shouldConvert = isRoot;
2684 var loop = function ( key ) {
2685 keys.push(key);
2686 var value = validateProp(key, propsOptions, propsData, vm);
2687 /* istanbul ignore else */
2688 if (process.env.NODE_ENV !== 'production') {
2689 if (isReservedProp[key]) {
2690 warn(
2691 ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."),
2692 vm
2693 );
2694 }
2695 defineReactive$$1(props, key, value, function () {
2696 if (vm.$parent && !observerState.isSettingProps) {
2697 warn(
2698 "Avoid mutating a prop directly since the value will be " +
2699 "overwritten whenever the parent component re-renders. " +
2700 "Instead, use a data or computed property based on the prop's " +
2701 "value. Prop being mutated: \"" + key + "\"",
2702 vm
2703 );
2704 }
2705 });
2706 } else {
2707 defineReactive$$1(props, key, value);
2708 }
2709 // static props are already proxied on the component's prototype
2710 // during Vue.extend(). We only need to proxy props defined at
2711 // instantiation here.
2712 if (!(key in vm)) {
2713 proxy(vm, "_props", key);
2714 }
2715 };
2716
2717 for (var key in propsOptions) loop( key );
2718 observerState.shouldConvert = true;

Callers 2

initPropsFunction · 0.70
initInjectionsFunction · 0.70

Calls 4

validatePropFunction · 0.70
defineReactive$$1Function · 0.70
proxyFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected