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

Function loop

static/vuejs/vue.runtime.common.js:2680–2711  ·  view source on GitHub ↗
( key )

Source from the content-addressed store, hash-verified

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