MCPcopy Index your code
hub / github.com/keepfool/vue-tutorials / processPropValue

Function processPropValue

06.Router/basic/js/vue.js:6168–6186  ·  view source on GitHub ↗

* Process a prop with a rawValue, applying necessary coersions, * default values & assertions and call the given callback with * processed value. * * @param {Vue} vm * @param {Object} prop * @param {*} rawValue * @param {Function} fn

(vm, prop, rawValue, fn)

Source from the content-addressed store, hash-verified

6166 */
6167
6168 function processPropValue(vm, prop, rawValue, fn) {
6169 var isSimple = prop.dynamic && isSimplePath(prop.parentPath);
6170 var value = rawValue;
6171 if (value === undefined) {
6172 value = getPropDefaultValue(vm, prop);
6173 }
6174 value = coerceProp(prop, value, vm);
6175 var coerced = value !== rawValue;
6176 if (!assertProp(prop, value, vm)) {
6177 value = undefined;
6178 }
6179 if (isSimple && !coerced) {
6180 withoutConversion(function () {
6181 fn(value);
6182 });
6183 } else {
6184 fn(value);
6185 }
6186 }
6187
6188 /**
6189 * Set a prop's initial value on a vm and its data object.

Callers 2

initPropFunction · 0.70
updatePropFunction · 0.70

Calls 6

isSimplePathFunction · 0.70
getPropDefaultValueFunction · 0.70
coercePropFunction · 0.70
assertPropFunction · 0.70
withoutConversionFunction · 0.70
fnFunction · 0.70

Tested by

no test coverage detected