Skip to content
masterclass Buddy

Vue.js · Function

readonly

readonly() returns a readonly proxy for an object or ref. Reads remain reactive, but writes through the proxy are blocked and warn.

Last updated

Syntax

function readonly<T extends object>(target: T): DeepReadonly<UnwrapNestedRefs<T>>

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • reactive()
  • shallowReadonly()
  • watchEffect()

Source: Reactivity API: Core | Vue.js. Checked 2026-11-03.