Skip to content

Commit 364ba9d

Browse files
authored
Merge pull request #7 from vuefe/2.0-cn
update
2 parents fd2896e + 92a5365 commit 364ba9d

35 files changed

+2469
-306
lines changed

src/api/index.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,22 @@ type: api
7979

8080
> [Sentry](https://sentry.io), an error tracking service, provides [official integration](https://sentry.io/for/vue/) using this option.
8181
82+
### ignoredElements
83+
84+
- **Type:** `Array<string>`
85+
86+
- **Default:** `[]`
87+
88+
- **Usage:**
89+
90+
``` js
91+
Vue.config.ignoredElements = [
92+
'my-custom-web-component', 'another-web-component'
93+
]
94+
```
95+
96+
Make Vue ignore custom elements defined outside of Vue (e.g., using the Web Components APIs). Otherwise, it will throw a warning about an `Unknown custom element`, assuming that you forgot to register a global component or misspelled a component name.
97+
8298
### keyCodes
8399

84100
- **类型:** `{ [key: string]: number }`
@@ -249,7 +265,7 @@ type: api
249265

250266
- **用法:**
251267

252-
注册或获取全局组件。
268+
注册或获取全局组件。注册自动用给的 `id` 做组件名称。
253269

254270
``` js
255271
// 注册组件,传入一个扩展过的构造器
@@ -815,7 +831,7 @@ type: api
815831

816832
- **类型:** `Array<string>`
817833

818-
- **默认值:** `["{{", "}}"]`
834+
- **默认值:** `{% raw %}["{{", "}}"]{% endraw %}`
819835

820836
- **详细:**
821837

src/examples/hackernews.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ order: 10
1515
{% endraw %}
1616

1717
> [Live Demo](https://vue-hn.now.sh/)
18-
> 笔记:如果没在特定时间段用到它,那么本示例需要一些加载时间
18+
> 注:如果在一段时间内没有人访问过该网站,则需要一些加载时间
1919
>
2020
> [[Source](https://github.com/vuejs/vue-hackernews-2.0)]
2121

src/examples/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ order: 0
66

77
> 蠢萌的 Markdown 编辑器。
88
9-
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/pq22eoj5/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>
9+
<iframe width="100%" height="500" src="https://jsfiddle.net/chrisvfritz/rdjjpc7a/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

src/examples/todomvc.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ order: 9
66

77
> 本例是一个完全和规范一致的 TodoMVC 实现,只用了 120 行有效的 JavaScript(不包含注释和空行)。
88
9+
<p class="tip">Note that if your web browser is configured to block 3rd-party data/cookies, the example below will not work, as the `localStorage` data will fail to be saved from JSFiddle. You'll have to click on `Edit in JSFiddle` to see the live result.</p>
10+
911
<iframe width="100%" height="500" src="https://jsfiddle.net/yyx990803/4dr2fLb7/embedded/result,html,js,css" allowfullscreen="allowfullscreen" frameborder="0"></iframe>

src/guide/class-and-style.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type: guide
44
order: 6
55
---
66

7-
数据绑定一个常见需求是操作元素的 class 列表和它的内联样式。因为它们都是 attribute ,我们可以用` v-bind` 处理它们:只需要计算出表达式最终的字符串。不过,字符串拼接麻烦又易错。因此,在 `v-bind ` 用于 ` class ``style ` 时, Vue.js 专门增强了它。表达式的结果类型除了字符串之外,还可以是对象或数组。
7+
数据绑定一个常见需求是操作元素的 class 列表和它的内联样式。因为它们都是属性 ,我们可以用` v-bind` 处理它们:只需要计算出表达式最终的字符串。不过,字符串拼接麻烦又易错。因此,在 `v-bind ` 用于 ` class ``style ` 时, Vue.js 专门增强了它。表达式的结果类型除了字符串之外,还可以是对象或数组。
88

99
## 绑定 HTML Class
1010

@@ -15,11 +15,9 @@ order: 6
1515
``` html
1616
<div v-bind:class="{ active: isActive }"></div>
1717
```
18-
上面的语法表示 class`active` 的更新将取决于数据属性 `isActive` 是否为 [truthiness](https://developer.mozilla.org/en-US/docs/Glossary/Truthy)
18+
上面的语法表示 class`active` 的更新将取决于数据属性 `isActive` 是否为[真值](https://developer.mozilla.org/en-US/docs/Glossary/Truthy)
1919

20-
我们可以传给 v-bind:class 一个对象,以动态地切换 class 。注意 v-bind:class 指令可以与普通的 class 特性共存
21-
22-
我们也可以在对象中传入多个属性用来动态切换多个 class 。注意 `v-bind:class` 指令可以与普通的 class 特性共存。如下模板:
20+
我们也可以在对象中传入更多属性用来动态切换多个 class 。此外, `v-bind:class` 指令可以与普通的 class 属性共存。如下模板:
2321

2422
``` html
2523
<div class="static"
@@ -42,7 +40,7 @@ data: {
4240
<div class="static active"></div>
4341
```
4442

45-
`isActive` 或者 `hasError` 变化时,class列表将相应地更新。例如,如果 `hasError` 的值为 `true` , class列表将变为 `"static active text-danger"`
43+
`isActive` 或者 `hasError` 变化时,class 列表将相应地更新。例如,如果 `hasError` 的值为 `true` , class列表将变为 `"static active text-danger"`
4644

4745
你也可以直接绑定数据里的一个对象:
4846

@@ -57,7 +55,7 @@ data: {
5755
}
5856
}
5957
```
60-
渲染的结果和上面一样。我们也可以在这里绑定一个返回对象的[计算属性](computed.html)。这是一个常用且强大的模式:
58+
渲染的结果和上面一样。我们也可以在这里绑定返回对象的[计算属性](computed.html)。这是一个常用且强大的模式:
6159

6260

6361
``` html

src/guide/comparison.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ Vue 相比于 Angular 2 则更加灵活,Vue 官方提供了构建工具来协
284284

285285
开始使用 Vue,你使用的是熟悉的 HTML、符合 ES5 规则的 JavaScript(也就是纯 JavaScript)。有了这些基本的技能,你可以快速地掌握它([指南](/guide))并投入开发 。
286286

287-
Angular 2 的学习曲线是非常陡峭的。即使不包括 TypeScript,它的[开始指南](https://angular.io/docs/js/latest/quickstart.html)中所用的就有 ES2015 标准的 JavaScript,18个 NPM 依赖包,4 个文件和超过 3 千多字的介绍,这一切都是为了完成个 Hello World。而[Vue's Hello World](index.html#Hello-World)就非常简单。甚至我们并不用花费一整个页面去介绍它。
287+
Angular 2 的学习曲线是非常陡峭的。即使不包括 TypeScript,它的[开始指南](https://angular.io/docs/js/latest/quickstart.html)中所用的就有 ES2015 标准的 JavaScript,18个 NPM 依赖包,4 个文件和超过 3 千多字的介绍,这一切都是为了完成个 Hello World。而[Vue's Hello World](https://jsfiddle.net/chrisvfritz/50wL7mdz/)就非常简单。甚至我们并不用花费一整个页面去介绍它。
288288

289289
## Ember
290290

@@ -328,7 +328,6 @@ Riot 2.0 提供了一个类似于基于组件的开发模型(在 Riot 中称
328328
- [过渡效果系统](transitions.html)。Riot 现在还没有提供。
329329
- 更好的性能。Riot [尽管声称](https://github.com/vuejs/vuejs.org/issues/346)其使用了虚拟 DOM,但实际上用的还是脏检查机制,因此和 Angular 1 患有相同的性能问题。
330330

331-
332331
***
333332

334333
> 原文:http://vuejs.org/guide/comparison.html

0 commit comments

Comments
 (0)