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

Function bindObjectProps

static/vuejs/vue.runtime.common.js:3461–3494  ·  view source on GitHub ↗

* Runtime helper for merging v-bind="object" into a VNode's data.

(
  data,
  tag,
  value,
  asProp
)

Source from the content-addressed store, hash-verified

3459 * Runtime helper for merging v-bind="object" into a VNode's data.
3460 */
3461function bindObjectProps (
3462 data,
3463 tag,
3464 value,
3465 asProp
3466) {
3467 if (value) {
3468 if (!isObject(value)) {
3469 process.env.NODE_ENV !== 'production' && warn(
3470 'v-bind without argument expects an Object or Array value',
3471 this
3472 );
3473 } else {
3474 if (Array.isArray(value)) {
3475 value = toObject(value);
3476 }
3477 var hash;
3478 for (var key in value) {
3479 if (key === 'class' || key === 'style') {
3480 hash = data;
3481 } else {
3482 var type = data.attrs && data.attrs.type;
3483 hash = asProp || config.mustUseProp(tag, type, key)
3484 ? data.domProps || (data.domProps = {})
3485 : data.attrs || (data.attrs = {});
3486 }
3487 if (!(key in hash)) {
3488 hash[key] = value[key];
3489 }
3490 }
3491 }
3492 }
3493 return data
3494}
3495
3496/* */
3497

Callers

nothing calls this directly

Calls 3

isObjectFunction · 0.70
toObjectFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected