From 83de7362224fe351b7a43d6083bea5303decdf5b Mon Sep 17 00:00:00 2001 From: Nikolay Pugachev Date: Sun, 23 May 2021 02:12:48 +0300 Subject: [PATCH] docs(README): update unwrap ref in an array limitations (#700) Refs do not unwrap in a reactive array or nested array of a reactive object since 3.0.0-alpha.6 version. Hence, there are not limitations. See issue: https://github.com/vuejs/vue-next/issues/737 --- README.md | 21 --------------------- README.zh-CN.md | 21 --------------------- 2 files changed, 42 deletions(-) diff --git a/README.md b/README.md index c6c1f02e..7477b3d6 100644 --- a/README.md +++ b/README.md @@ -122,27 +122,6 @@ export default { ### `Ref` Unwrap -`Unwrap` is not working with Array index. - -
- -❌ Should NOT store ref as a direct child of Array - - -```js -const state = reactive({ - list: [ref(0)], -}) -// no unwrap, `.value` is required -state.list[0].value === 0 // true - -state.list.push(ref(1)) -// no unwrap, `.value` is required -state.list[1].value === 1 // true -``` - -
-
Should NOT use ref in a plain object when working with Array diff --git a/README.zh-CN.md b/README.zh-CN.md index 913d18c4..5175ac0e 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -117,27 +117,6 @@ export default { ### `Ref` 自动展开 (unwrap) -数组索引属性无法进行自动展开: - -
- -❌ 不要 使用数组直接存取 ref 对象 - - -```js -const state = reactive({ - list: [ref(0)], -}) -// 不会自动展开, 须使用 `.value` -state.list[0].value === 0 // true - -state.list.push(ref(1)) -// 不会自动展开, 须使用 `.value` -state.list[1].value === 1 // true -``` - -
-
不要 在数组中使用含有 ref 的普通对象