Skip to content
This repository was archived by the owner on Aug 8, 2022. It is now read-only.

docs: translate reactive #218

Merged
merged 7 commits into from
Oct 25, 2020
Merged

docs: translate reactive #218

merged 7 commits into from
Oct 25, 2020

Conversation

veaba
Copy link
Member

@veaba veaba commented Oct 24, 2020

@veaba veaba requested review from Justineo and Jinjiang and removed request for Justineo October 24, 2020 08:05
veaba and others added 5 commits October 25, 2020 15:00
Co-authored-by: Jinjiang <zhaojinjiang@me.com>
Co-authored-by: Jinjiang <zhaojinjiang@me.com>
Co-authored-by: Jinjiang <zhaojinjiang@me.com>
Co-authored-by: Jinjiang <zhaojinjiang@me.com>
Co-authored-by: Jinjiang <zhaojinjiang@me.com>
@veaba
Copy link
Member Author

veaba commented Oct 25, 2020

Merge suggested change done.

@Jinjiang Jinjiang merged commit 7981494 into master Oct 25, 2020
@Jinjiang Jinjiang deleted the docs-reactive branch October 25, 2020 07:17
@@ -10,7 +10,7 @@
const obj = reactive({ count: 0 })
```

响应式转换是“”的——它影响所有嵌套 property。在基于 [ES2015 Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) 的实现中,返回的代理是**不**等于原始对象。建议只使用响应式代理,避免依赖原始对象。
响应式转换是“深层”的——它影响所有嵌套 property。在基于 [ES2015 Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) 的实现中,返回的代理是**不**等于原始对象。建议只使用响应式代理,避免依赖原始对象。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
响应式转换是“深层”的——它影响所有嵌套 property。在基于 [ES2015 Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) 的实现中,返回的代理是****等于原始对象。建议只使用响应式代理,避免依赖原始对象。
响应式转换是“深层”的——它影响所有嵌套 property。在基于 [ES2015 Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) 的实现中,返回的代理是****等于原始对象的。建议只使用响应式代理,避免依赖原始对象。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里漏了一个“代理”没处理。另外关于 proxy 的翻译,这里也讨论一下:https://github.com/orgs/vuejs/teams/docs-cn/discussions/12

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

“代理”的问题需要抽取出来单独处理,我会在下一个 PR 中,修复以下 suggested change

@@ -225,7 +225,7 @@ watchEffect(() => {
console.log(shallow.value.greet)
})

// 这不会触发效果,因为ref很浅
// 这不会触发作用,因为 ref 很浅层
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 这不会触发作用,因为 ref 很浅层
// 这不会触发作用,因为 ref 是浅层的

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

effect flush timing 之前译为了“副作用刷新时机”。那么单独的 effect 我们是否应该翻译成“副作用”?

/cc @Jinjiang

@@ -1343,7 +1343,7 @@ computed: {
5. **组合 API** (使用组合 API 的入口点)
- `setup`

6. **Local State** (本地的响应式 property)
6. **Local State** (原生响应式 property)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个应该是本地的吧

@@ -363,18 +363,18 @@ import { ref, onMounted, watch, toRefs, computed } from 'vue'

// in our component
setup (props) {
// 使用 `toRefs` 创建对props的 `user` property 的响应式引用
// 使用 `toRefs` 创建对 props 的 `user` property 的响应式引用
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 使用 `toRefs` 创建对 props `user` property 的响应式引用
// 使用 `toRefs` 创建对 props 中的 `user` property 的响应式引用


### 强制更新

如果你发现自己需要在 Vue 中强制更新,在 99.99%的情况下,你在某个地方犯了错误。例如,你可能依赖于 Vue 反应性系统未跟踪的状态,例如,在组件创建之后添加了 `data` 属性。
如果你发现自己需要在 Vue 中强制更新,在 99.99%的情况下,你在某个地方犯了错误。例如,你可能依赖于 Vue 响应性系统未跟踪的状态,例如,在组件创建之后添加了 `data` 属性。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
如果你发现自己需要在 Vue 中强制更新,在 99.99%的情况下,你在某个地方犯了错误。例如,你可能依赖于 Vue 响应性系统未跟踪的状态,例如,在组件创建之后添加了 `data` 属性。
如果你发现自己需要在 Vue 中强制更新,在 99.99% 的情况下,你在某个地方犯了错误。例如,你可能依赖于 Vue 响应性系统未跟踪的状态,比如在组件创建之后添加了 `data` 属性。

减少重复

veaba added a commit that referenced this pull request Oct 26, 2020
@veaba veaba mentioned this pull request Oct 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants