del() — vue Function Reference
Architecture documentation for the del() function in index.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD 1e8dd21f_c506_2ce7_ecf3_262154cc2d3f["del()"] 012c0986_6b9d_ad59_8fba_57884312dd3b["index.ts"] 1e8dd21f_c506_2ce7_ecf3_262154cc2d3f -->|defined in| 012c0986_6b9d_ad59_8fba_57884312dd3b 399dccff_c2d5_9afe_7a83_39f1cdff28f7["notify()"] 1e8dd21f_c506_2ce7_ecf3_262154cc2d3f -->|calls| 399dccff_c2d5_9afe_7a83_39f1cdff28f7 style 1e8dd21f_c506_2ce7_ecf3_262154cc2d3f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/core/observer/index.ts lines 283–323
export function del(target: any[] | object, key: any) {
if (__DEV__ && (isUndef(target) || isPrimitive(target))) {
warn(
`Cannot delete reactive property on undefined, null, or primitive value: ${target}`
)
}
if (isArray(target) && isValidArrayIndex(key)) {
target.splice(key, 1)
return
}
const ob = (target as any).__ob__
if ((target as any)._isVue || (ob && ob.vmCount)) {
__DEV__ &&
warn(
'Avoid deleting properties on a Vue instance or its root $data ' +
'- just set it to null.'
)
return
}
if (isReadonly(target)) {
__DEV__ &&
warn(`Delete operation on key "${key}" failed: target is readonly.`)
return
}
if (!hasOwn(target, key)) {
return
}
delete target[key]
if (!ob) {
return
}
if (__DEV__) {
ob.dep.notify({
type: TriggerOpTypes.DELETE,
target: target,
key
})
} else {
ob.dep.notify()
}
}
Domain
Subdomains
Defined In
Calls
Source
Frequently Asked Questions
What does del() do?
del() is a function in the vue codebase, defined in src/core/observer/index.ts.
Where is del() defined?
del() is defined in src/core/observer/index.ts at line 283.
What does del() call?
del() calls 1 function(s): notify.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free