{"record":{"id":"642158cd39dfe276","repo":"Meituan-Dianping/mpvue","slug":"el-tag-v-model-value-you-are-binding-v-642158","errorCode":null,"errorMessage":"<${el.tag} v-model=\"${value}\">: You are binding v-model directly to a v-for iteration alias. This will not be able to modify the v-for source array because writing to the alias is like modifying a function local variable. Consider using an array of objects and use v-model on an object property instead.","messagePattern":"<(.+?) v-model=\"(.+?)\">: You are binding v-model directly to a v-for iteration alias\\. This will not be able to modify the v-for source array because writing to the alias is like modifying a function local variable\\. Consider using an array of objects and use v-model on an object property instead\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/compiler/parser/index.js","lineNumber":596,"sourceCode":"\n/* istanbul ignore next */\nfunction guardIESVGBug (attrs) {\n  const res = []\n  for (let i = 0; i < attrs.length; i++) {\n    const attr = attrs[i]\n    if (!ieNSBug.test(attr.name)) {\n      attr.name = attr.name.replace(ieNSPrefix, '')\n      res.push(attr)\n    }\n  }\n  return res\n}\n\nfunction checkForAliasModel (el, value) {\n  let _el = el\n  while (_el) {\n    if (_el.for && _el.alias === value) {\n      warn(\n        `<${el.tag} v-model=\"${value}\">: ` +\n        `You are binding v-model directly to a v-for iteration alias. ` +\n        `This will not be able to modify the v-for source array because ` +\n        `writing to the alias is like modifying a function local variable. ` +\n        `Consider using an array of objects and use v-model on an object property instead.`\n      )\n    }\n    _el = _el.parent\n  }\n}\n","sourceCodeStart":578,"sourceCodeEnd":607,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/compiler/parser/index.js#L578-L607","documentation":"Dev-only warning from checkForAliasModel, invoked when the v-model directive is processed: v-model is bound directly to a v-for iteration alias (e.g. v-for=\"item in list\" with v-model=\"item\" on a primitive). Assignments write only to the loop-local alias and never propagate to the source array, so two-way binding silently fails.","triggerScenarios":"Thrown at src/compiler/parser/index.js:596 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Bind v-model to a property of objects in the array, e.g. v-model=\"item.text\"","Mutate the source array by index: use :value + @input=\"list[i] = $event\" for primitives","Restructure data as an array of objects so v-model writes to a property"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b","analyzedAt":"2026-09-02T05:17:40.946Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}