Skip to content

Commit 86022ed

Browse files
committed
Merge remote-tracking branch 'upstream/2.0-cn' into 2.0-cn
2 parents 019be69 + 658acfb commit 86022ed

File tree

8 files changed

+207
-152
lines changed

8 files changed

+207
-152
lines changed

src/about/apidoc.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: 参与API翻译
3+
type: about
4+
order: 2
5+
---
6+
7+
> 官方文档仓库:http://vuejs.org/guide/
8+
> 翻译文档仓库:https://github.com/vuefe/vuejs.org
9+
10+
- 加QQ群参与翻译: `427447379`
11+
- [翻译Guide认领](https://github.com/vuefe/vuejs.org/issues/1)
12+
- [翻译API认领](https://github.com/vuefe/vuejs.org/issues/44)
13+
- [翻译指引](https://github.com/vuefe/vuejs.org/issues/25)
14+
15+
## API文档翻译进度
16+
17+
序号 | 是否完成 | 对应小节名称 | 中文标题 | 贡献者 | 认领者
18+
----- | ------- | ------------- | --- | --- | ---
19+
1 | x | Global Config | 全局配置 | |
20+
2 | x | Global API | 全局API | |
21+
3 | x | Options / Data | 选项 / 数据 | |
22+
4 | x | Options / DOM | 选项 / DOM | |
23+
5 | x | Options / Lifecycle Hooks | 选项 / 生命周期钩子 | |
24+
6 | x | Options / Assets | 选项 / 资源 | |
25+
7 | x | Options / Misc | 选项 / 杂项 | |
26+
8 | x | Instance Properties | 实例属性 | |
27+
9 | x | Instance Methods / Data | 实例方法 / 数据 | |
28+
10 | x | Instance Methods / Events | 实例方法 / 事件 | |
29+
11 | x | Instance Methods / Lifecycle | 实例方法 / 生命周期 | |
30+
12 | x | Directives | 指令| | @tingtien
31+
13 | x | Special Attributes | 特殊元素 | |
32+
14 | x | Built-In Components | 内置的组件 | |
33+
15 | x | VNode Interface | VNode接口 | |
34+
16 | x | Server-Side Rendering | 服务端渲染| | |

src/about/guide.md

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,35 @@
11
---
2-
title: 参与指南
2+
title: 参与教程翻译
33
type: about
4-
order: 2
4+
order: 1
55
---
66

7+
> 官方文档仓库:http://vuejs.org/guide/
8+
> 翻译文档仓库:https://github.com/vuefe/vuejs.org
9+
710
- 加QQ群参与翻译: `427447379`
811
- [翻译Guide认领](https://github.com/vuefe/vuejs.org/issues/1)
12+
- [翻译API认领](https://github.com/vuefe/vuejs.org/issues/44)
913
- [翻译指引](https://github.com/vuefe/vuejs.org/issues/25)
1014

11-
## 翻译进度
12-
13-
> 原文地址:http://vuejs.org/guide/
14-
> 仓库:https://github.com/vuefe/vuejs.org
15-
16-
### 说明
17-
18-
- 翻译前,请在此回复认领
19-
- 认领格式 :` 我翻译 + 文档序号` 即可
15+
## 教程(guide)文档翻译进度
2016

21-
## 以下所有文档所在目录为 `src/guide/xxx.md`
17+
> 以下所有文档所在目录为 `src/guide/xxx.md`
2218
2319
### Essentials 基础
2420

2521
序号 | 是否完成 | 对应文档文件名 | 中文标题 | 贡献者 | 认领者
2622
----- | ------- | ------------- | --- | --- | ---
27-
1 | 是 | installation.md | 安装 | @dingyiming | -
28-
2 | | index.md | 介绍 | | @dingyiming
29-
3 | 是 | instance.md | 实例 | @dingyiming | -
30-
4 | × | syntax.md | 模板语法 | | |
31-
5 | 是 | computed.md | 计算属性 | @dingyiming | -
32-
6 | × | class-and-style.md | Class 与 Style 绑定 | |
33-
7 | 是 | conditional.md | 条件渲染 | @dingyiming | -
23+
1 | 是 | installation.md | 安装 | @dingyiming | @dingyiming
24+
2 | | index.md | 介绍 | @hijiangtao | @dingyiming @hijiangtao
25+
3 | 是 | instance.md | 实例 | @dingyiming | @dingyiming
26+
4 | × | syntax.md | 模板语法 | | @tingtien
27+
5 | 是 | computed.md | 计算属性 | @dingyiming | @dingyiming
28+
6 | × | class-and-style.md | Class 与 Style 绑定 | | @595074187
29+
7 | 是 | conditional.md | 条件渲染 | @dingyiming | @dingyiming
3430
8 | 是 | list.md | 列表渲染 | @tingtien | @tingtien
35-
9 | 是 | events.md | 事件处理器 | @dingyiming | -
36-
10 | 是 | forms.md | 表单控件绑定 | @dingyiming | -
31+
9 | 是 | events.md | 事件处理器 | @dingyiming | @dingyiming
32+
10 | 是 | forms.md | 表单控件绑定 | @dingyiming | @dingyiming
3733
11 | × | components.md | 组件 | | @ezreally
3834

3935
### Advanced 进阶
@@ -47,10 +43,10 @@ order: 2
4743
16 | 是 | custom-directive.md | 自定义指令 | @harrytospring | @harrytospring
4844
17 | 是 | mixins.md | 混合 | @harrytospring | @harrytospring
4945
18 | x | plugins.md | 插件 | | @hgcoder
50-
19 | x | single-file-components.md | 单文件组件 | |
46+
19 | x | single-file-components.md | 单文件组件 | | @ATLgo
5147
20 | 是 | routing.md | 路由 | @dingyiming | @dingyiming
52-
21 | x | state-management.md | 状态管理 | |
53-
22 | x | unit-testing.md | 单元测试 | | @70data
48+
21 | | state-management.md | 状态管理 | @dear-lizhihua | @dear-lizhihua
49+
22 | | unit-testing.md | 单元测试 | @70data | @70data
5450
23 | 是 | ssr.md | 服务端渲染 | @dingyiming | @dingyiming
5551
24 | x | migration.md | 1.x迁移 | | @harrytospring
5652

@@ -59,4 +55,4 @@ order: 2
5955
序号 | 是否完成 | 对应文档文件名 | 中文标题 | 贡献者 | 认领者
6056
----- | ------- | ------------- | --- | --- | ---
6157
25 | x | comparison.md | 对比其他框架 | | @yongbolv @daix6
62-
26 | x | join.md | 加入Vue.js社区 | | @daix6
58+
26 | | join.md | 加入Vue.js社区 | @daix6 | @daix6

src/about/index.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,45 @@
11
---
2-
title: 关于翻译
2+
title: 参与指南
33
type: about
4-
order: 1
4+
order: 0
55
---
66

7+
> 官方文档仓库:http://vuejs.org/guide/
8+
> 翻译文档仓库:https://github.com/vuefe/vuejs.org
9+
710
- 加QQ群参与翻译: `427447379`
8-
- [翻译Guide认领](https://github.com/vuefe/vuejs.org/issues/1)
11+
- [翻译Guide认领](https://github.com/vuefe/vuejs.org/issues/1)
12+
- [翻译API认领](https://github.com/vuefe/vuejs.org/issues/44)
13+
- [翻译指引](https://github.com/vuefe/vuejs.org/issues/25)
14+
15+
16+
## 说明
17+
18+
- 翻译前,请在对应 issue 回复认领
19+
- 认领格式 :` 我翻译 + 文档序号` 即可
20+
- 支持多人协作翻译,冲突可以解决,认领过的,如果你觉着他太慢,可以再次认领,加速翻译,知道大家都是牺牲业余时间来贡献,所以慢也是可以理解的,慢就需要大家一起帮帮忙了!谢谢。
21+
22+
## 基础指引
23+
24+
### 基础环境
25+
26+
- `node lastest`
27+
- `npm lastest`
28+
- `npm i -g hexo`
29+
- `git bash`
30+
31+
### 主要步骤
32+
33+
- `github fork` 仓库代码到自己的账号下
34+
- `git clone fork` 的仓库代码到本地
35+
- 进入项目目录 ,`npm install` 安装依赖
36+
- `hexo s` 启动项目,浏览器打开 `localhost:4000` 查看当前文档情况,已支持browsersync热加载 ,可边改边看
37+
- 然后用自己喜欢的编辑器,比如`sublime text 3` 打开项目目录,找到 `src/guide` 目录 , 也就是当前文档翻译的目录,根据github 仓库中,认领issue中对照文件名.md ,认领自己打算翻译的内容,然后打开该文件就可以进行翻译了!
38+
![image](https://cloud.githubusercontent.com/assets/12537013/18859543/b6e3d724-84a7-11e6-9bb6-812c45c16782.png)
39+
40+
- 翻译完后,使用git 提交更新到自己的仓库,后,在`https://github.com/vuefe/vuejs.org/pulls` 提交合并请求
41+
![image](https://cloud.githubusercontent.com/assets/12537013/19106938/68c786fa-8b1c-11e6-8ea0-30f97cf1a83b.png)
42+
43+
- 在QQ群里呼叫群主,合并请求
44+
- 群主合并内容,并记录贡献, 更新在线静态站内容
45+

src/changelog/index.md

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

77
[更新日志](https://github.com/vuejs/vue/releases)
88

9+
## [v2.0.1](https://github.com/vuejs/vue/releases/tag/v2.0.1)
10+
11+
![image](https://cloud.githubusercontent.com/assets/12537013/19139459/6de9ff46-8bb7-11e6-82ee-e3e0f2eab71d.png)
12+
913

1014
## [v2.0.0-rc.8](https://github.com/vuejs/vue/releases/tag/v2.0.0-rc.8)
1115

src/guide/class-and-style.md

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,31 @@ title: Class 与 Style 绑定
33
type: guide
44
order: 6
55
---
6+
数据绑定一个常见需求是操作元素的 class 列表和它的内联样式。因为它们都是 attribute,我们可以用` v-bind` 处理它们:只需要计算出表达式最终的字符串。不过,字符串拼接麻烦又易错。因此,在 `v-bind `用于` class ``style `时,Vue.js 专门增强了它。表达式的结果类型除了字符串之外,还可以是对象或数组。
67

7-
A common need for data binding is manipulating an element's class list and its inline styles. Since they are both attributes, we can use `v-bind` to handle them: we just need to calculate a final string with our expressions. However, meddling with string concatenation is annoying and error-prone. For this reason, Vue provides special enhancements when `v-bind` is used with `class` and `style`. In addition to strings, the expressions can also evaluate to objects or arrays.
88

9-
## Binding HTML Classes
9+
## 绑定 HTML Class
1010

11-
### Object Syntax
11+
### 对象语法
1212

13-
We can pass an object to `v-bind:class` to dynamically toggle classes:
13+
我们可以传给 `v-bind:class` 一个对象,以动态地切换 class。
1414

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)
1819

19-
The above syntax means the presence of the `active` class will be determined by the [truthiness](https://developer.mozilla.org/en-US/docs/Glossary/Truthy) of the data property `isActive`.
20+
我们可以传给 v-bind:class 一个对象,以动态地切换 class。注意 v-bind:class 指令可以与普通的 class 特性共存
2021

21-
You can have multiple classes toggled by having more fields in the object. In addition, the `v-bind:class` directive can also co-exist with the plain `class` attribute. So given the following template:
22+
我们也可以在对象中传入多个属性用来动态切换多个class.注意 `v-bind:class` 指令可以与普通的 class 特性共存.如下模板:
2223

2324
``` html
2425
<div class="static"
2526
v-bind:class="{ active: isActive, 'text-danger': hasError }">
2627
</div>
2728
```
2829

29-
And the following data:
30+
如下 data:
3031

3132
``` js
3233
data: {
@@ -35,15 +36,15 @@ data: {
3536
}
3637
```
3738

38-
It will render:
39+
渲染为:
3940

4041
``` html
4142
<div class="static active"></div>
4243
```
4344

44-
When `isActive` or `hasError` changes, the class list will be updated accordingly. For example, if `hasError` becomes `true`, the class list will become `"static active text-danger"`.
45+
`isActive` 或者 `hasError` 变化时, class列表将相应地更新。例如,如果 `hasError` 的值为 `true`, class列表将变为 `"static active text-danger"`.
4546

46-
The bound object doesn't have to be inline:
47+
你也可以直接绑定数据里的一个对象:
4748

4849
``` html
4950
<div v-bind:class="classObject"></div>
@@ -56,8 +57,8 @@ data: {
5657
}
5758
}
5859
```
60+
渲染的结果和上面一样。我们也可以在这里绑定一个返回对象的[计算属性](computed.html)。这是一个常用且强大的模式:
5961

60-
This will render the same result. We can also bind to a [computed property](computed.html) that returns an object. This is a common and powerful pattern:
6162

6263
``` html
6364
<div v-bind:class="classObject"></div>
@@ -77,9 +78,9 @@ computed: {
7778
}
7879
```
7980

80-
### Array Syntax
81+
### 数组语法
8182

82-
We can pass an array to `v-bind:class` to apply a list of classes:
83+
我们可以把一个数组传给 `v-bind:class`,以应用一个 class 列表:
8384

8485
``` html
8586
<div v-bind:class="[activeClass, errorClass]">
@@ -91,31 +92,31 @@ data: {
9192
}
9293
```
9394

94-
Which will render:
95+
渲染为:
9596

9697
``` html
9798
<div class="active text-danger"></div>
9899
```
99100

100-
If you would like to also toggle a class in the list conditionally, you can do it with a ternary expression:
101+
如果你也想根据条件切换列表中的 class,可以用三元表达式:
101102

102103
``` html
103104
<div v-bind:class="[isActive ? activeClass : '', errorClass]">
104105
```
106+
此例始终添加 `errorClass`,但是只有在 `isActive` 是 true 时添加`activeClass`
105107

106-
This will always apply `errorClass`, but will only apply `activeClass` when `isActive` is `true`.
107-
108-
However, this can be a bit verbose if you have multiple conditional classes. That's why it's also possible to use the object syntax inside array syntax:
108+
不过,当有多个条件 class 时这样写有些繁琐。可以在数组语法中使用对象语法:
109109

110110
``` html
111111
<div v-bind:class="[{ active: isActive }, errorClass]">
112112
```
113113

114-
## Binding Inline Styles
114+
## 绑定内联样式
115+
116+
### 对象语法
115117

116-
### Object Syntax
118+
`v-bind:style` 的对象语法十分直观——看着非常像 CSS,其实它是一个 JavaScript 对象。CSS 属性名可以用驼峰式(camelCase)或短横分隔命名(kebab-case):
117119

118-
The object syntax for `v-bind:style` is pretty straightforward - it looks almost like CSS, except it's a JavaScript object. You can use either camelCase or kebab-case for the CSS property names:
119120

120121
``` html
121122
<div v-bind:style="{ color: activeColor, fontSize: fontSize + 'px' }"></div>
@@ -127,7 +128,7 @@ data: {
127128
}
128129
```
129130

130-
It is often a good idea to bind to a style object directly so that the template is cleaner:
131+
直接绑定到一个样式对象通常更好,让模板更清晰:
131132

132133
``` html
133134
<div v-bind:style="styleObject"></div>
@@ -139,18 +140,19 @@ data: {
139140
fontSize: '13px'
140141
}
141142
}
142-
```
143143

144-
Again, the object syntax is often used in conjunction with computed properties that return objects.
144+
```
145+
同样的,对象语法常常结合返回对象的计算属性使用。
145146

146-
### Array Syntax
147+
### 数组语法
147148

148-
The array syntax for `v-bind:style` allows you to apply multiple style objects to the same element:
149+
`v-bind:style` 的数组语法可以将多个样式对象应用到一个元素上:
149150

150151
``` html
151152
<div v-bind:style="[baseStyles, overridingStyles]">
152153
```
153154

154-
### Auto-prefixing
155+
### 自动添加前缀
156+
157+
`v-bind:style`使用需要厂商前缀的 CSS 属性时,如 `transform`,Vue.js 会自动侦测并添加相应的前缀。
155158

156-
When you use a CSS property that requires vendor prefixes in `v-bind:style`, for example `transform`, Vue will automatically detect and add appropriate prefixes to the applied styles.

0 commit comments

Comments
 (0)