Home / Function/ checkForAliasModel() — vue Function Reference

checkForAliasModel() — vue Function Reference

Architecture documentation for the checkForAliasModel() function in index.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  0e2e0e33_ed3c_0f90_9245_4b781a654aec["checkForAliasModel()"]
  a8b5582c_75a3_d739_c9b5_27e2ceb67bc3["processAttrs()"]
  a8b5582c_75a3_d739_c9b5_27e2ceb67bc3 -->|calls| 0e2e0e33_ed3c_0f90_9245_4b781a654aec
  style 0e2e0e33_ed3c_0f90_9245_4b781a654aec fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/compiler/parser/index.ts lines 984–999

function checkForAliasModel(el, value) {
  let _el = el
  while (_el) {
    if (_el.for && _el.alias === value) {
      warn(
        `<${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.`,
        el.rawAttrsMap['v-model']
      )
    }
    _el = _el.parent
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does checkForAliasModel() do?
checkForAliasModel() is a function in the vue codebase.
What calls checkForAliasModel()?
checkForAliasModel() is called by 1 function(s): processAttrs.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free