File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -160,26 +160,27 @@ b.list[0].count.value === 0 // true
160
160
161
161
<details >
162
162
<summary >
163
- ❌ <b >Should</b > always use <code >ref</code > in a <code >reactive</code > when working with <code >Array</code >
163
+ ✅ <b >Should</b > always use <code >ref</code > in a <code >reactive</code > when working with <code >Array</code >
164
164
</summary >
165
165
166
166
``` js
167
167
const a = reactive ({
168
- count: ref (0 ),
169
- })
170
- const b = reactive ({
171
- list: [a],
168
+ list: [
169
+ reactive ({
170
+ count: ref (0 ),
171
+ })
172
+ ],
172
173
})
173
174
// unwrapped
174
- b .list [0 ].count === 0 // true
175
+ a .list [0 ].count === 0 // true
175
176
176
- b .list .push (
177
+ a .list .push (
177
178
reactive ({
178
179
count: ref (1 ),
179
180
})
180
181
)
181
182
// unwrapped
182
- b .list [1 ].count === 1 // true
183
+ a .list [1 ].count === 1 // true
183
184
```
184
185
185
186
</details >
You can’t perform that action at this time.
0 commit comments