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
  c7a14743_134c_7cfc_7023_433336707c47["baseSetAttr()"]
  a13dc9cc_24b7_ee02_c711_52c1500ce296["setAttr()"]
  a13dc9cc_24b7_ee02_c711_52c1500ce296 -->|calls| c7a14743_134c_7cfc_7023_433336707c47
  style c7a14743_134c_7cfc_7023_433336707c47 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