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 6f809a6e_ef45_f412_fb8a_24fc51dd5b72["directive.componentUpdated()"] 69a7e351_3007_a43c_618a_93588eb8db15["model.ts"] 6f809a6e_ef45_f412_fb8a_24fc51dd5b72 -->|defined in| 69a7e351_3007_a43c_618a_93588eb8db15 1bc6ac59_b296_f53f_3227_e124ca6c7c75["setSelected()"] 6f809a6e_ef45_f412_fb8a_24fc51dd5b72 -->|calls| 1bc6ac59_b296_f53f_3227_e124ca6c7c75 23f7525e_aa3d_77b4_0e14_7b37fcd97489["hasNoMatchingOption()"] 6f809a6e_ef45_f412_fb8a_24fc51dd5b72 -->|calls| 23f7525e_aa3d_77b4_0e14_7b37fcd97489 bcd2513d_41ad_4466_521f_87dfe0b8f7fd["trigger()"] 6f809a6e_ef45_f412_fb8a_24fc51dd5b72 -->|calls| bcd2513d_41ad_4466_521f_87dfe0b8f7fd style 6f809a6e_ef45_f412_fb8a_24fc51dd5b72 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, defined in src/platforms/web/runtime/directives/model.ts.
Where is directive.componentUpdated() defined?
directive.componentUpdated() is defined in src/platforms/web/runtime/directives/model.ts at line 53.
What does directive.componentUpdated() call?
directive.componentUpdated() calls 3 function(s): hasNoMatchingOption, setSelected, trigger.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free