File tree 4 files changed +38
-3
lines changed
4 files changed +38
-3
lines changed Original file line number Diff line number Diff line change
1
+ <!--
2
+
3
+ 首先感谢您的参与!
4
+ 为了让社区工作更有效率和质量,我们做了一些约定,希望得到您的理解和支持。
5
+
6
+ 首先请阅读 README[1] 了解如何参与贡献。
7
+ 如果你参与的是翻译相关的工作,有劳额外移步 wiki[2] 了解相关注意事项。
8
+
9
+ 谢谢!
10
+
11
+ [1] https://github.com/vuejs/cn.vuejs.org/tree/master/README.md
12
+ [2] https://github.com/vuejs/cn.vuejs.org/wiki
13
+
14
+ -->
Original file line number Diff line number Diff line change
1
+ <!--
2
+
3
+ 首先感谢您的参与!
4
+ 为了让社区工作更有效率和质量,我们做了一些约定,希望得到您的理解和支持。
5
+
6
+ 首先请阅读 README[1] 了解如何参与贡献。
7
+ 如果你参与的是翻译相关的工作,有劳额外移步 wiki[2] 了解相关注意事项。
8
+
9
+ 谢谢!
10
+
11
+ [1] https://github.com/vuejs/cn.vuejs.org/tree/master/README.md
12
+ [2] https://github.com/vuejs/cn.vuejs.org/wiki
13
+
14
+ -->
Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ $ hexo server
21
21
* 发 issue 讨论译法或书写格式
22
22
* 发 issue 讨论部署或协作流程上的问题
23
23
24
+ 有劳在翻译之前移步 [ wiki] ( https://github.com/vuejs/cn.vuejs.org/wiki ) 了解相关注意事项。
25
+
24
26
** 注意:**
25
27
26
28
1 . 原则上这里只进行英文版对应的翻译工作,如果觉得原文有改进之处,或任何不仅针对中文版,而受益所有语言版本的想法,建议直接在英文版仓库讨论。
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ order: 6
15
15
``` html
16
16
<div v-bind:class =" { active: isActive }" ></div >
17
17
```
18
- 上面的语法表示 ` active ` 这个 class 存在与否将取决于数据属性 ` isActive ` 是否为 [ truthy ] ( https://developer.mozilla.org/zh-CN/docs/Glossary/Truthy ) 。
18
+ 上面的语法表示 ` active ` 这个 class 存在与否将取决于数据属性 ` isActive ` 的 [ truthiness ] ( https://developer.mozilla.org/zh-CN/docs/Glossary/Truthy ) 。
19
19
20
20
你可以在对象中传入更多属性来动态切换多个 class。此外,` v-bind:class ` 指令也可以与普通的 class 属性共存。当有如下模板:
21
21
@@ -105,7 +105,7 @@ data: {
105
105
<div v-bind:class =" [isActive ? activeClass : '', errorClass]" ></div >
106
106
```
107
107
108
- 这样写将始终添加 ` errorClass ` ,但是只有在 ` isActive ` 是 [ truthy] ( https://developer.mozilla.org/zh-CN/docs/Glossary/Truthy ) 时才添加 ` activeClass ` 。
108
+ 这样写将始终添加 ` errorClass ` ,但是只有在 ` isActive ` 是 truthy< sup > [[ 1 ]] ( #译者注 ) </ sup > 时才添加 ` activeClass ` 。
109
109
110
110
不过,当有多个条件 class 时这样写有些繁琐。所以在数组语法中也可以使用对象语法:
111
111
@@ -145,7 +145,7 @@ HTML 将被渲染为:
145
145
<my-component v-bind:class =" { active: isActive }" ></my-component >
146
146
```
147
147
148
- 当 ` isActive ` 为真值 (译者注: truthy 不是 ` true ` , [ 参考这里 ] ( https://developer.mozilla.org/zh-CN/docs/Glossary/Truthy ) ) 时,HTML 将被渲染成为:
148
+ 当 ` isActive ` 为 truthy< sup > [[ 1 ]] ( #译者注 ) </ sup > 时,HTML 将被渲染成为:
149
149
150
150
``` html
151
151
<p class =" foo bar active" >Hi</p >
@@ -209,3 +209,8 @@ data: {
209
209
```
210
210
211
211
这样写只会渲染数组中最后一个被浏览器支持的值。在本例中,如果浏览器支持不带浏览器前缀的 flexbox,那么就只会渲染 ` display: flex ` 。
212
+
213
+ <small >
214
+ <div id =" 译者注 " >__译者注__</div >
215
+ [ 1] truthy 不是 ` true ` ,详见 [ MDN] ( https://developer.mozilla.org/zh-CN/docs/Glossary/Truthy ) 的解释。
216
+ </small >
You can’t perform that action at this time.
0 commit comments