Home / Function/ directive.componentUpdated() — vue Function Reference

directive.componentUpdated() — vue Function Reference

Architecture documentation for the directive.componentUpdated() function in model.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  f41bc58b_eeba_9a34_19b5_f517598a27f5["directive.componentUpdated()"]
  c5669fa5_f589_5187_60a1_228b9a62ccc3["model.ts"]
  f41bc58b_eeba_9a34_19b5_f517598a27f5 -->|defined in| c5669fa5_f589_5187_60a1_228b9a62ccc3
  167d42a8_5fd2_00fa_bfdd_120034ea39d6["setSelected()"]
  f41bc58b_eeba_9a34_19b5_f517598a27f5 -->|calls| 167d42a8_5fd2_00fa_bfdd_120034ea39d6
  071176c4_25aa_b345_8db1_348e278cd61c["hasNoMatchingOption()"]
  f41bc58b_eeba_9a34_19b5_f517598a27f5 -->|calls| 071176c4_25aa_b345_8db1_348e278cd61c
  de1fbbb8_38d0_c643_ac8c_0b6651bdbbcb["trigger()"]
  f41bc58b_eeba_9a34_19b5_f517598a27f5 -->|calls| de1fbbb8_38d0_c643_ac8c_0b6651bdbbcb
  style f41bc58b_eeba_9a34_19b5_f517598a27f5 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/platforms/web/runtime/directives/model.ts lines 53–74

  componentUpdated(el, binding, vnode) {
    if (vnode.tag === 'select') {
      setSelected(el, binding, vnode.context)
      // in case the options rendered by v-for have changed,
      // it's possible that the value is out-of-sync with the rendered options.
      // detect such cases and filter out values that no longer has a matching
      // option in the DOM.
      const prevOptions = el._vOptions
      const curOptions = (el._vOptions = [].map.call(el.options, getValue))
      if (curOptions.some((o, i) => !looseEqual(o, prevOptions[i]))) {
        // trigger change event if
        // no matching option found for at least one value
        const needReset = el.multiple
          ? binding.value.some(v => hasNoMatchingOption(v, curOptions))
          : binding.value !== binding.oldValue &&
            hasNoMatchingOption(binding.value, curOptions)
        if (needReset) {
          trigger(el, 'change')
        }
      }
    }
  }

Domain

Subdomains

Frequently Asked Questions

What does directive.componentUpdated() do?
directive.componentUpdated() is a function in the vue codebase, defined in src/platforms/web/runtime/directives/model.ts.
Where is directive.componentUpdated() defined?
directive.componentUpdated() is defined in src/platforms/web/runtime/directives/model.ts at line 53.
What does directive.componentUpdated() call?
directive.componentUpdated() calls 3 function(s): hasNoMatchingOption, setSelected, trigger.

Analyze Your Own Codebase

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

Try Supermodel Free