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

directive.inserted() — vue Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  fa225f1d_e2bf_4507_d8f0_35de4c8ca300["directive.inserted()"]
  4f35d37e_3682_9972_3d5a_b513df864ac0["setSelected()"]
  fa225f1d_e2bf_4507_d8f0_35de4c8ca300 -->|calls| 4f35d37e_3682_9972_3d5a_b513df864ac0
  style fa225f1d_e2bf_4507_d8f0_35de4c8ca300 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/platforms/web/runtime/directives/model.ts lines 24–51

  inserted(el, binding, vnode, oldVnode) {
    if (vnode.tag === 'select') {
      // #6903
      if (oldVnode.elm && !oldVnode.elm._vOptions) {
        mergeVNodeHook(vnode, 'postpatch', () => {
          directive.componentUpdated(el, binding, vnode)
        })
      } else {
        setSelected(el, binding, vnode.context)
      }
      el._vOptions = [].map.call(el.options, getValue)
    } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
      el._vModifiers = binding.modifiers
      if (!binding.modifiers.lazy) {
        el.addEventListener('compositionstart', onCompositionStart)
        el.addEventListener('compositionend', onCompositionEnd)
        // Safari < 10.2 & UIWebView doesn't fire compositionend when
        // switching focus before confirming composition choice
        // this also fixes the issue where some browsers e.g. iOS Chrome
        // fires "change" instead of "input" on autocomplete.
        el.addEventListener('change', onCompositionEnd)
        /* istanbul ignore if */
        if (isIE9) {
          el.vmodel = true
        }
      }
    }
  },

Domain

Subdomains

Frequently Asked Questions

What does directive.inserted() do?
directive.inserted() is a function in the vue codebase.
What does directive.inserted() call?
directive.inserted() calls 1 function(s): setSelected.

Analyze Your Own Codebase

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

Try Supermodel Free