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

Commit affc4fa

Browse files
JinjiangJustineowxsms
authored
Translated some new guide content (#649)
* Translated some new guide content * Apply suggestions from code review Co-authored-by: GU Yiling <[email protected]> Co-authored-by: wxsm <[email protected]> Co-authored-by: GU Yiling <[email protected]> Co-authored-by: wxsm <[email protected]>
1 parent 106cd9b commit affc4fa

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

src/guide/introduction.md

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -311,22 +311,11 @@ app.mount('#todo-list-app')
311311

312312
### 与自定义元素的关系
313313

314-
<!-- TODO: translation -->
315-
You may have noticed that Vue components look similar to **Custom Elements**, which are part of the [Web Components Spec](https://www.w3.org/wiki/WebComponents/). Indeed, parts of Vue's component design (for example the slot API) were influenced by the spec before it was natively implemented in browsers.
314+
你可能已经注意到 Vue 组件与**自定义元素**非常类似——它是 [Web Components 规范](https://www.w3.org/wiki/WebComponents/)的一部分。确实,Vue 的组件设计 (如插槽 API) 在浏览器原生支持该规范前就部分受到了它的影响。
316315

317-
The main difference is that Vue's component model is designed as a part of a coherent framework that provides many additional features necessary for building non-trivial applications, for example reactive templating and state management - both of which the spec does not cover.
316+
它们之间主要的不同在于,Vue 组件的数据模型是作为框架的一部分而设计的,而该框架为构建复杂应用提供了很多必要的附加功能。例如响应式模板和状态管理——这两者都没有被该规范所覆盖。
318317

319-
Vue also provides great support for both consuming and creating custom elements. For more details, check out the [Vue and Web Components](/guide/web-components.html) section.
320-
321-
<!-- 你可能已经注意到 Vue 组件非常类似于自定义元素——它是 [Web 组件规范](https://www.w3.org/wiki/WebComponents/)的一部分,这是因为 Vue 的组件语法部分参考了该规范。例如 Vue 组件实现了 [Slot API](https://github.com/w3c/webcomponents/blob/gh-pages/proposals/Slots-Proposal.md) 与 `is` attribute。但是,还是有几个关键差别: -->
322-
323-
<!-- 1. Web Components 规范已经完成并通过,但未被所有浏览器原生实现。目前 Safari 10.1+、Chrome 54+ 和 Firefox 63+ 原生支持 Web Components。相比之下,Vue 组件不需要任何 polyfill,并且在所有支持的浏览器之下表现一致 (IE 11 除外——请移步阅读[这里](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0038-vue3-ie11-support.md)的详情)。必要时,Vue 组件也可以包裹于原生自定义元素之内。 -->
324-
325-
<!-- [//]: # 'TODO: link to compatibility build' -->
326-
327-
<!-- 2. Vue 组件提供了纯自定义元素所不具备的一些重要功能,最突出的是跨组件数据流、自定义事件通信以及构建工具集成。 -->
328-
329-
<!-- 虽然 Vue 内部没有使用自定义元素,不过在应用使用自定义元素、或以自定义元素形式发布时,[依然有很好的互操作性](https://custom-elements-everywhere.com/#vue)。Vue CLI 也支持将 Vue 组件构建成为原生的自定义元素。 -->
318+
Vue 也为创建和使用自定义元素提供了很好的支持。关于其更多细节,请浏览 [Vue 和 Web Components](/guide/web-components.html) 章节。
330319

331320
## 准备好了吗?
332321

src/guide/reactivity-computed-watchers.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,7 @@ watchEffect(
173173

174174
`flush` 选项还接受 `sync`,这将强制效果始终同步触发。然而,这是低效的,应该很少需要。
175175

176-
<!-- TODO: translation -->
177-
In Vue >= 3.2.0, `watchPostEffect` and `watchSyncEffect` aliases can also be used to make the code intention more obvious.
176+
从 Vue 3.2.0 开始,`watchPostEffect``watchSyncEffect` 别名也可以用来让代码意图更加明显。
178177

179178
### 侦听器调试
180179

src/guide/web-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Vue and Web Components
1+
# Vue Web Components
22

33
<!-- TODO: translation -->
44
[Web Components](https://developer.mozilla.org/en-US/docs/Web/Web_Components) is an umbrella term for a set of web native APIs that allows developers to create reusable custom elements.

0 commit comments

Comments
 (0)