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

Translated some new guide content #649

Merged
merged 2 commits into from
Aug 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 3 additions & 14 deletions src/guide/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,22 +311,11 @@ app.mount('#todo-list-app')

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

<!-- TODO: translation -->
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.
你可能已经注意到 Vue 组件与**自定义元素**非常类似——它是 [Web Components 规范](https://www.w3.org/wiki/WebComponents/)的一部分。确实,Vue 的组件设计 (如插槽 API) 在浏览器原生支持该规范前就部分受到了它的影响。

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.
它们之间主要的不同在于,Vue 组件的数据模型是作为框架的一部分而设计的,而该框架为构建复杂应用提供了很多必要的附加功能。例如响应式模板和状态管理——这两者都没有被该规范所覆盖。

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.

<!-- 你可能已经注意到 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。但是,还是有几个关键差别: -->

<!-- 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 组件也可以包裹于原生自定义元素之内。 -->

<!-- [//]: # 'TODO: link to compatibility build' -->

<!-- 2. Vue 组件提供了纯自定义元素所不具备的一些重要功能,最突出的是跨组件数据流、自定义事件通信以及构建工具集成。 -->

<!-- 虽然 Vue 内部没有使用自定义元素,不过在应用使用自定义元素、或以自定义元素形式发布时,[依然有很好的互操作性](https://custom-elements-everywhere.com/#vue)。Vue CLI 也支持将 Vue 组件构建成为原生的自定义元素。 -->
Vue 也为创建和使用自定义元素提供了很好的支持。关于其更多细节,请浏览 [Vue 和 Web Components](/guide/web-components.html) 章节。

## 准备好了吗?

Expand Down
3 changes: 1 addition & 2 deletions src/guide/reactivity-computed-watchers.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ watchEffect(

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

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

### 侦听器调试

Expand Down
2 changes: 1 addition & 1 deletion src/guide/web-components.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Vue and Web Components
# Vue Web Components

<!-- TODO: translation -->
[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.
Expand Down