File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -77,6 +77,19 @@ original.count++
77
77
copy.count++ // warning!
78
78
` ` `
79
79
80
+ As with [` reactive ` ](#reactive ), if any property uses a ` ref ` it will be automatically unwrapped when it is accessed via the proxy :
81
+
82
+ ` ` ` js
83
+ const raw = {
84
+ count: ref(123)
85
+ }
86
+
87
+ const copy = readonly(raw)
88
+
89
+ console.log(raw.count.value) // 123
90
+ console.log(copy.count) // 123
91
+ ` ` `
92
+
80
93
## ` isProxy `
81
94
82
95
Checks if an object is a proxy created by [` reactive ` ](#reactive ) or [` readonly ` ](#readonly ).
@@ -191,6 +204,8 @@ isReactive(state.nested) // false
191
204
state .nested .bar ++ // non-reactive
192
205
```
193
206
207
+ Unlike [ ` reactive ` ] ( #reactive ) , any property that uses a [ ` ref ` ] ( /api/refs-api.html#ref ) will ** not** be automatically unwrapped by the proxy.
208
+
194
209
## ` shallowReadonly `
195
210
196
211
Creates a proxy that makes its own properties readonly, but does not perform deep readonly conversion of nested objects (exposes raw values).
@@ -209,3 +224,5 @@ state.foo++
209
224
isReadonly (state .nested ) // false
210
225
state .nested .bar ++ // works
211
226
```
227
+
228
+ Unlike [ ` readonly ` ] ( #readonly ) , any property that uses a [ ` ref ` ] ( /api/refs-api.html#ref ) will ** not** be automatically unwrapped by the proxy.
You can’t perform that action at this time.
0 commit comments