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 1dafb5a9_b144_8425_a384_6a574c550a19["directive.componentUpdated()"] 4f35d37e_3682_9972_3d5a_b513df864ac0["setSelected()"] 1dafb5a9_b144_8425_a384_6a574c550a19 -->|calls| 4f35d37e_3682_9972_3d5a_b513df864ac0 65ecf248_3144_6fe6_6b3c_e026bf041584["looseEqual()"] 1dafb5a9_b144_8425_a384_6a574c550a19 -->|calls| 65ecf248_3144_6fe6_6b3c_e026bf041584 95f25cd9_aa67_97cd_0b32_972cc8e1ae6e["hasNoMatchingOption()"] 1dafb5a9_b144_8425_a384_6a574c550a19 -->|calls| 95f25cd9_aa67_97cd_0b32_972cc8e1ae6e e08f5c48_2642_a987_b7a8_acbcea961289["trigger()"] 1dafb5a9_b144_8425_a384_6a574c550a19 -->|calls| e08f5c48_2642_a987_b7a8_acbcea961289 style 1dafb5a9_b144_8425_a384_6a574c550a19 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
Source
Frequently Asked Questions
What does directive.componentUpdated() do?
directive.componentUpdated() is a function in the vue codebase.
What does directive.componentUpdated() call?
directive.componentUpdated() calls 4 function(s): hasNoMatchingOption, looseEqual, setSelected, trigger.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free