Home / Function/ normalizeDirectives() — vue Function Reference

normalizeDirectives() — vue Function Reference

Architecture documentation for the normalizeDirectives() function in directives.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  7d1db663_ac2f_906c_6f45_82393aeeb280["normalizeDirectives()"]
  b91b554e_74a2_233a_0bd9_3f9cf7cb3052["_update()"]
  b91b554e_74a2_233a_0bd9_3f9cf7cb3052 -->|calls| 7d1db663_ac2f_906c_6f45_82393aeeb280
  51ff252f_2eee_d577_9665_c2c9b3880d4e["getRawDirName()"]
  7d1db663_ac2f_906c_6f45_82393aeeb280 -->|calls| 51ff252f_2eee_d577_9665_c2c9b3880d4e
  style 7d1db663_ac2f_906c_6f45_82393aeeb280 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/vdom/modules/directives.ts lines 88–120

function normalizeDirectives(
  dirs: Array<VNodeDirective> | undefined,
  vm: Component
): { [key: string]: VNodeDirective } {
  const res = Object.create(null)
  if (!dirs) {
    // $flow-disable-line
    return res
  }
  let i: number, dir: VNodeDirective
  for (i = 0; i < dirs.length; i++) {
    dir = dirs[i]
    if (!dir.modifiers) {
      // $flow-disable-line
      dir.modifiers = emptyModifiers
    }
    res[getRawDirName(dir)] = dir
    if (vm._setupState && vm._setupState.__sfc) {
      const setupDef = dir.def || resolveAsset(vm, '_setupState', 'v-' + dir.name)
      if (typeof setupDef === 'function') {
        dir.def = {
          bind: setupDef,
          update: setupDef,
        }
      } else {
        dir.def = setupDef
      }
    }
    dir.def = dir.def || resolveAsset(vm.$options, 'directives', dir.name, true)
  }
  // $flow-disable-line
  return res
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does normalizeDirectives() do?
normalizeDirectives() is a function in the vue codebase.
What does normalizeDirectives() call?
normalizeDirectives() calls 1 function(s): getRawDirName.
What calls normalizeDirectives()?
normalizeDirectives() is called by 1 function(s): _update.

Analyze Your Own Codebase

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

Try Supermodel Free