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

Function bindObjectProps

static/vuejs/vue.js:3465–3498  ·  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

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

Callers

nothing calls this directly

Calls 3

isObjectFunction · 0.70
toObjectFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected