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
  0c2c456e_5db1_3b87_8b40_2e5fe4c21313["baseSetAttr()"]
  79ac8337_fd93_af91_1c63_9d155d74dbf5["attrs.ts"]
  0c2c456e_5db1_3b87_8b40_2e5fe4c21313 -->|defined in| 79ac8337_fd93_af91_1c63_9d155d74dbf5
  ba2408c9_3afc_6948_9503_46554375131e["setAttr()"]
  ba2408c9_3afc_6948_9503_46554375131e -->|calls| 0c2c456e_5db1_3b87_8b40_2e5fe4c21313
  style 0c2c456e_5db1_3b87_8b40_2e5fe4c21313 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, defined in src/platforms/web/runtime/modules/attrs.ts.
Where is baseSetAttr() defined?
baseSetAttr() is defined in src/platforms/web/runtime/modules/attrs.ts at line 84.
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