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

Function bindObjectProps

static/vuejs/vue.esm.js:3463–3496  ·  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

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

Callers

nothing calls this directly

Calls 3

isObjectFunction · 0.70
toObjectFunction · 0.70
warnFunction · 0.50

Tested by

no test coverage detected