Skip to content

Commit 7c63704

Browse files
author
npugachev
committed
docs(README): update unwrap ref in an array limitations
Refs do not unwrap in a reactive array or nested array of a reactive object since v3.0.0-alpha.6 version. See issue: vuejs/core#737
1 parent 59c3ac3 commit 7c63704

File tree

2 files changed

+0
-42
lines changed

2 files changed

+0
-42
lines changed

README.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -122,27 +122,6 @@ export default {
122122
123123
### `Ref` Unwrap
124124

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-
146125
<details>
147126
<summary>
148127
❌ <b>Should NOT</b> use <code>ref</code> in a plain object when working with <code>Array</code>

README.zh-CN.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -117,27 +117,6 @@ export default {
117117
118118
### `Ref` 自动展开 (unwrap)
119119

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-
141120
<details>
142121
<summary>
143122
❌ <b>不要</b> 在数组中使用含有 <code>ref</code> 的普通对象

0 commit comments

Comments
 (0)