Skip to content

Commit 43320ce

Browse files
authored
Merge pull request #158 from tolerious/tolerious
update translate for class-and-style.md and forms.md.
2 parents a468cde + c7010d6 commit 43320ce

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/v2/guide/class-and-style.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,39 +109,39 @@ data: {
109109
<div v-bind:class="[{ active: isActive }, errorClass]">
110110
```
111111

112-
### With Components
112+
### 用在组件上
113113

114-
> This section assumes knowledge of [Vue Components](components.html). Feel free to skip it and come back later.
114+
> 这个章节假设你已经对 [Vue 组件](components.html) 有一定的了解。当然你也可以跳过这里,稍后再回过头来看。
115115
116-
When you use the `class` attribute on a custom component, those classes will be added to the component's root element. Existing classes on this element will not be overwritten.
116+
当你在一个定制的组件上用到 `class` 属性的时候,这些类将被添加到根元素上面,这个元素上已经存在的类不会被覆盖。
117117

118-
For example, if you declare this component:
118+
例如,如果你声明了这个组件:
119119

120120
``` js
121121
Vue.component('my-component', {
122122
template: '<p class="foo bar">Hi</p>'
123123
})
124124
```
125125

126-
Then add some classes when using it:
126+
然后在使用它的时候添加一些类:
127127

128128
``` html
129129
<my-component class="baz boo"></my-component>
130130
```
131131

132-
The rendered HTML will be:
132+
HTML 最终将被渲染成为:
133133

134134
``` html
135135
<p class="foo bar baz boo">Hi</p>
136136
```
137137

138-
The same is true for class bindings:
138+
同样的适用于绑定 HTML class :
139139

140140
``` html
141141
<my-component v-bind:class="{ active: isActive }"></my-component>
142142
```
143143

144-
When `isActive` is truthy, the rendered HTML will be:
144+
`isActive` 为 true 的时候,HTML 将被渲染成为:
145145

146146
``` html
147147
<div class="foo bar active"></div>
@@ -197,4 +197,3 @@ data: {
197197
> 原文:http://vuejs.org/guide/class-and-style.html
198198
199199
***
200-

src/v2/guide/forms.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,12 +362,11 @@ vm.selected.number // -> 123
362362
<input v-model.trim="msg">
363363
```
364364

365-
## `v-model` with Components
365+
## `v-model` 与组件
366366

367-
> If you're not yet familiar with Vue's components, just skip this for now.
368-
369-
HTML's built-in input types won't always meet your needs. Fortunately, Vue components allow you to build reusable inputs with completely customized behavior. These inputs even work with `v-model`! To learn more, read about [custom inputs](components.html#Form-Input-Components-using-Custom-Events) in the Components guide.
367+
> 如果你对组件还不熟悉,跳过这里即可。
370368
369+
HTML 的内置 input 类型可能不会总是能满足你的需求。幸运的是, Vue 的组件系统允许你创建一个具有自定义行为的并且可重用的 inputs 。这些 inputs 甚至可以与 `v-model` 一起使用!想了解更多,阅读组件文档中的 [自定义inputs](components.html#Form-Input-Components-using-Custom-Events)
371370

372371
***
373372

0 commit comments

Comments
 (0)