{"record":{"id":"b015853e8ddef2bb","repo":"Meituan-Dianping/mpvue","slug":"v-el-elseif-else-if-el-elseif-b01585","errorCode":null,"errorMessage":"v-${el.elseif ? ('else-if=\"' + el.elseif + '\"') : 'else'} used on element <${el.tag}> without corresponding v-if.","messagePattern":"v-(.+?) used on element <(.+?)> without corresponding v-if\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/compiler/parser/index.js","lineNumber":382,"sourceCode":"    if (getAndRemoveAttr(el, 'v-else') != null) {\n      el.else = true\n    }\n    const elseif = getAndRemoveAttr(el, 'v-else-if')\n    if (elseif) {\n      el.elseif = elseif\n    }\n  }\n}\n\nfunction processIfConditions (el, parent) {\n  const prev = findPrevElement(parent.children)\n  if (prev && prev.if) {\n    addIfCondition(prev, {\n      exp: el.elseif,\n      block: el\n    })\n  } else if (process.env.NODE_ENV !== 'production') {\n    warn(\n      `v-${el.elseif ? ('else-if=\"' + el.elseif + '\"') : 'else'} ` +\n      `used on element <${el.tag}> without corresponding v-if.`\n    )\n  }\n}\n\nfunction findPrevElement (children: Array<any>): ASTElement | void {\n  let i = children.length\n  while (i--) {\n    if (children[i].type === 1) {\n      return children[i]\n    } else {\n      if (process.env.NODE_ENV !== 'production' && children[i].text !== ' ') {\n        warn(\n          `text \"${children[i].text.trim()}\" between v-if and v-else(-if) ` +\n          `will be ignored.`\n        )\n      }","sourceCodeStart":364,"sourceCodeEnd":400,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/compiler/parser/index.js#L364-L400","documentation":"Dev-only warning in processIfConditions: a v-else / v-else-if element was found whose previous sibling in the parent's children is not a v-if element (or there is none). The conditional chain cannot be attached to anything, so the else block would render unconditionally; the compiler warns and treats the chain as broken.","triggerScenarios":"Thrown at src/compiler/parser/index.js:382 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure v-else/v-else-if immediately follows a v-if (or another v-else-if) element with no intervening element or v-if omission","Remove the orphan v-else/v-else-if if the v-if was deleted","Check that no wrapper element or comment-breaking element sits between them (plain whitespace text is tolerated only as single spaces)"],"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"}