Shallow version of ().
Unlike (), there is no deep conversion: only root-level properties are made readonly. Property values are stored and exposed as-is - this also means properties with ref values will not be automatically unwrapped.
const state = shallowReadonly({ foo: 1, nested: { bar: 2 }})// mutating state's own properties will failstate.foo++// ...but works on nested objectsisReadonly(state.nested) // false// worksstate.nested.bar++
https://vuejs.org/api/reactivity-advanced.html#shallowreadonly
The source object.
Generated using TypeDoc
Shallow version of ().
Unlike (), there is no deep conversion: only root-level properties are made readonly. Property values are stored and exposed as-is - this also means properties with ref values will not be automatically unwrapped.
Example
See
https://vuejs.org/api/reactivity-advanced.html#shallowreadonly