{"record":{"id":"d7c1a1805518703b","repo":"Meituan-Dianping/mpvue","slug":"v-on-without-argument-expects-an-object-value","errorCode":null,"errorMessage":"v-on without argument expects an Object value","messagePattern":"v-on without argument expects an Object value","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/weex-vue-framework/factory.js","lineNumber":4013,"sourceCode":"      }\n    }\n  } else {\n    markStaticNode(tree, key, isOnce);\n  }\n}\n\nfunction markStaticNode (node, key, isOnce) {\n  node.isStatic = true;\n  node.key = key;\n  node.isOnce = isOnce;\n}\n\n/*  */\n\nfunction bindObjectListeners (data, value) {\n  if (value) {\n    if (!isPlainObject(value)) {\n      process.env.NODE_ENV !== 'production' && warn(\n        'v-on without argument expects an Object value',\n        this\n      );\n    } else {\n      var on = data.on = data.on ? extend({}, data.on) : {};\n      for (var key in value) {\n        var existing = on[key];\n        var ours = value[key];\n        on[key] = existing ? [].concat(ours, existing) : ours;\n      }\n    }\n  }\n  return data\n}\n\n/*  */\n\nfunction initRender (vm) {","sourceCodeStart":3995,"sourceCodeEnd":4031,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/packages/weex-vue-framework/factory.js#L3995-L4031","documentation":"`bindObjectListeners` implements `v-on=\"value\"` without an argument, which merges a plain object of `{ eventName: handler }` into the vnode's `on` data. If the value is truthy but not a plain object, Vue warns because listeners cannot be derived from it.","triggerScenarios":"`<div v-on=\"someArray\">` or `v-on=\"handlerFn\"` (a function, not an object of handlers); passing a reactive/non-plain object (e.g. a class instance or observed object) to `v-on`; `v-on=\"cond && handlers\"` where the truthy branch isn't a plain object.","commonSituations":"Migrating from `v-on:click=\"fn\"` by deleting the argument; spreading listener maps stored in Vuex (observed objects); passing class-instance event maps from TypeScript code.","solutions":["Bind a plain object of handlers: `v-on=\"{ click: onClick, input: onInput }\"`.","Convert to a plain object: `v-on=\"{ ...listenerMap }\"` or build it in a computed returning a fresh `{}`.","If a single handler was intended, restore the argument: `v-on:click=\"fn\"`.","Guard: `v-on=\"isPlainObj(h) ? h : {}\"`."],"exampleFix":"// before\n<div v-on=\"handleClick\" />\n// after\n<div v-on=\"{ click: handleClick }\" />","handlingStrategy":"type-guard","validationCode":"if (listeners != null && (typeof listeners !== 'object' || Array.isArray(listeners) || listeners.constructor !== Object)) {\n  throw new TypeError('v-on without argument requires a plain object of handlers');\n}","typeGuard":"function isListenerMap(v) {\n  return v != null && typeof v === 'object' && !Array.isArray(v) && Object.getPrototypeOf(v) === Object.prototype;\n}","tryCatchPattern":null,"preventionTips":["Always pass plain `{ event: handler }` objects to argless v-on.","Unwrap observed store objects: `v-on=\"{ ...map }\"`.","Type the prop/computed feeding v-on as `Record<string, Function>`."],"tags":["vue","v-on","events","template","dev-warning"],"backgroundTag":"von-expects-object","analyzedSha":"6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b","analyzedAt":"2026-09-02T05:17:40.946Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}