Home / Function/ baseSetAttr() — vue Function Reference

baseSetAttr() — vue Function Reference

Architecture documentation for the baseSetAttr() function in attrs.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  4180f176_2eb5_ecee_e037_3c4080629fcc["baseSetAttr()"]
  f98c4ea9_22dc_9cb8_d81c_0505f3a992ae["setAttr()"]
  f98c4ea9_22dc_9cb8_d81c_0505f3a992ae -->|calls| 4180f176_2eb5_ecee_e037_3c4080629fcc
  style 4180f176_2eb5_ecee_e037_3c4080629fcc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/platforms/web/runtime/modules/attrs.ts lines 84–110

function baseSetAttr(el, key, value) {
  if (isFalsyAttrValue(value)) {
    el.removeAttribute(key)
  } else {
    // #7138: IE10 & 11 fires input event when setting placeholder on
    // <textarea>... block the first input event and remove the blocker
    // immediately.
    /* istanbul ignore if */
    if (
      isIE &&
      !isIE9 &&
      el.tagName === 'TEXTAREA' &&
      key === 'placeholder' &&
      value !== '' &&
      !el.__ieph
    ) {
      const blocker = e => {
        e.stopImmediatePropagation()
        el.removeEventListener('input', blocker)
      }
      el.addEventListener('input', blocker)
      // $flow-disable-line
      el.__ieph = true /* IE placeholder patched */
    }
    el.setAttribute(key, value)
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free