Home / Function/ defineReadonlyProperty() — vue Function Reference

defineReadonlyProperty() — vue Function Reference

Architecture documentation for the defineReadonlyProperty() function in readonly.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  66ae8013_0070_caaa_9e3a_a6b7cdb9bc85["defineReadonlyProperty()"]
  4f0f141e_f70c_4533_8c1b_de374c265d9a["createReadonly()"]
  4f0f141e_f70c_4533_8c1b_de374c265d9a -->|calls| 66ae8013_0070_caaa_9e3a_a6b7cdb9bc85
  b9b46a3f_0087_05b4_53ce_28ce6e544d03["readonly()"]
  66ae8013_0070_caaa_9e3a_a6b7cdb9bc85 -->|calls| b9b46a3f_0087_05b4_53ce_28ce6e544d03
  style 66ae8013_0070_caaa_9e3a_a6b7cdb9bc85 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/v3/reactivity/readonly.ts lines 99–117

function defineReadonlyProperty(
  proxy: any,
  target: any,
  key: string,
  shallow: boolean
) {
  Object.defineProperty(proxy, key, {
    enumerable: true,
    configurable: true,
    get() {
      const val = target[key]
      return shallow || !isPlainObject(val) ? val : readonly(val)
    },
    set() {
      __DEV__ &&
        warn(`Set operation on key "${key}" failed: target is readonly.`)
    }
  })
}

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does defineReadonlyProperty() do?
defineReadonlyProperty() is a function in the vue codebase.
What does defineReadonlyProperty() call?
defineReadonlyProperty() calls 1 function(s): readonly.
What calls defineReadonlyProperty()?
defineReadonlyProperty() is called by 1 function(s): createReadonly.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free