File tree Expand file tree Collapse file tree 2 files changed +0
-42
lines changed Expand file tree Collapse file tree 2 files changed +0
-42
lines changed Original file line number Diff line number Diff line change @@ -122,27 +122,6 @@ export default {
122
122
123
123
### ` Ref ` Unwrap
124
124
125
- ` Unwrap ` is not working with Array index.
126
-
127
- <details >
128
- <summary >
129
- ❌ <b >Should NOT</b > store <code >ref</code > as a <b >direct</b > child of <code >Array</code >
130
- </summary >
131
-
132
- ``` js
133
- const state = reactive ({
134
- list: [ref (0 )],
135
- })
136
- // no unwrap, `.value` is required
137
- state .list [0 ].value === 0 // true
138
-
139
- state .list .push (ref (1 ))
140
- // no unwrap, `.value` is required
141
- state .list [1 ].value === 1 // true
142
- ```
143
-
144
- </details >
145
-
146
125
<details >
147
126
<summary >
148
127
❌ <b >Should NOT</b > use <code >ref</code > in a plain object when working with <code >Array</code >
Original file line number Diff line number Diff line change @@ -117,27 +117,6 @@ export default {
117
117
118
118
### ` Ref ` 自动展开 (unwrap)
119
119
120
- 数组索引属性无法进行自动展开:
121
-
122
- <details >
123
- <summary >
124
- ❌ <b >不要</b > 使用数组直接存取 <code >ref</code > 对象
125
- </summary >
126
-
127
- ``` js
128
- const state = reactive ({
129
- list: [ref (0 )],
130
- })
131
- // 不会自动展开, 须使用 `.value`
132
- state .list [0 ].value === 0 // true
133
-
134
- state .list .push (ref (1 ))
135
- // 不会自动展开, 须使用 `.value`
136
- state .list [1 ].value === 1 // true
137
- ```
138
-
139
- </details >
140
-
141
120
<details >
142
121
<summary >
143
122
❌ <b >不要</b > 在数组中使用含有 <code >ref</code > 的普通对象
You can’t perform that action at this time.
0 commit comments