{"record":{"id":"29c9971fe3b7f863","repo":"Meituan-Dianping/mpvue","slug":"v-bind-without-argument-expects-an-object-or-array","errorCode":null,"errorMessage":"v-bind without argument expects an Object or Array value","messagePattern":"v-bind without argument expects an Object or Array value","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/weex-vue-framework/factory.js","lineNumber":3909,"sourceCode":"    return keyCodes !== eventKeyCode\n  }\n}\n\n/*  */\n\n/**\n * Runtime helper for merging v-bind=\"object\" into a VNode's data.\n */\nfunction bindObjectProps (\n  data,\n  tag,\n  value,\n  asProp,\n  isSync\n) {\n  if (value) {\n    if (!isObject(value)) {\n      process.env.NODE_ENV !== 'production' && warn(\n        'v-bind without argument expects an Object or Array value',\n        this\n      );\n    } else {\n      if (Array.isArray(value)) {\n        value = toObject(value);\n      }\n      var hash;\n      var loop = function ( key ) {\n        if (\n          key === 'class' ||\n          key === 'style' ||\n          isReservedAttribute(key)\n        ) {\n          hash = data;\n        } else {\n          var type = data.attrs && data.attrs.type;\n          hash = asProp || config.mustUseProp(tag, type, key)","sourceCodeStart":3891,"sourceCodeEnd":3927,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/packages/weex-vue-framework/factory.js#L3891-L3927","documentation":"`bindObjectProps` handles `v-bind` with no explicit argument (i.e. `v-bind=\"value\"`), which spreads an object (or array of objects) of props/attrs onto the element. If the bound value is truthy but not an object, Vue warns because there is nothing sensible to spread.","triggerScenarios":"`<div v-bind=\"someString\">`, `v-bind=\"42\"`, `v-bind=\"computedValue\"` where the computed returns a primitive instead of an object/array; template refactors that dropped the argument (`v-bind:x=\"obj\"` became `v-bind=\"obj\"` accidentally).","commonSituations":"Passing prop-spread objects from a parent as a string via an attribute; computed properties whose return type changed after a refactor; conditional spreads like `v-bind=\"cond && extraProps\"` where `cond` is a truthy non-object.","solutions":["Bind an object: `<div v-bind=\"{ id: x, class: y }\">` or `<div v-bind=\"propsBag\">`.","Fix the computed/data source to return an object (or array of objects).","Guard the binding: `v-bind=\"isObj ? propsBag : {}\"`.","If you meant a single attribute, restore the argument: `v-bind:id=\"value\"`."],"exampleFix":"// before\n<div v-bind=\"'id=foo'\" />\n// after\n<div v-bind=\"{ id: 'foo' }\" />","handlingStrategy":"type-guard","validationCode":"if (boundValue != null && typeof boundValue !== 'object') {\n  throw new TypeError('v-bind without argument requires an Object or Array');\n}","typeGuard":"function isBindableObject(v) {\n  return v != null && typeof v === 'object' && !Array.isArray(v) ? true : Array.isArray(v);\n}","tryCatchPattern":null,"preventionTips":["Keep argless v-bind values as objects/arrays in data/computed typings.","Guard conditional spreads: `v-bind=\"cond ? obj : {}\"`.","Restore the argument (`v-bind:id`) when binding a single attribute."],"tags":["vue","v-bind","template","dev-warning"],"backgroundTag":"vbind-expects-object","analyzedSha":"6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b","analyzedAt":"2026-09-02T05:17:40.946Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}