Skip to content

Commit

Permalink
Merge pull request #144 from vuefe/2.0
Browse files Browse the repository at this point in the history
获取官方英文文档更新
  • Loading branch information
dingyiming authored Nov 4, 2016
2 parents a4d9e9c + e98d4f0 commit 93f6f89
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
38 changes: 38 additions & 0 deletions src/guide/class-and-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,44 @@ data: {
<div v-bind:class="[{ active: isActive }, errorClass]">
```

### With Components

> This section assumes knowledge of [Vue Components](components.html). Feel free to skip it and come back later.
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.

For example, if you declare this component:

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

Then add some classes when using it:

``` html
<my-component class="baz boo"></my-component>
```

The rendered HTML will be:

``` html
<p class="foo bar baz boo">Hi</p>
```

The same is true for class bindings:

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

When `isActive` is truthy, the rendered HTML will be:

``` html
<div class="foo bar active"></div>
```

## 绑定内联样式

### 对象语法
Expand Down
2 changes: 1 addition & 1 deletion src/guide/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ Vue.component('child', {

### 动态 Props

类似于用 `v-bind` 绑定 HTML 特性到一个表达式,也可以用 `v-bind` 绑定动态 props 到父组件的数据。每当父组件的数据变化时,也会传导给子组件
类似于用 `v-bind` 绑定 HTML 特性到一个表达式,也可以用 `v-bind` 动态绑定 props 的值到父组件的数据中。每当父组件的数据变化时,该变化也会传导给子组件

``` html
<div>
Expand Down
2 changes: 1 addition & 1 deletion themes/vue/layout/partials/community_dropdown.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<li><a href="http://forum.vuejs.org" class="nav-link" target="_blank">论坛</a></li>
<li><a href="https://gitter.im/vuejs/vue" class="nav-link" target="_blank">聊天室</a></li>
<li><a href="https://twitter.com/vuejs" class="nav-link" target="_blank">Twitter</a></li>
<li><a href="https://vuejobs.com/?ref_source=vue" class="nav-link" target="_blank">Jobs</a></li>
<li><a href="https://vuejsjob.com/?ref=vuejs" class="nav-link" target="_blank">Jobs</a></li>
</ul>
</li>

0 comments on commit 93f6f89

Please sign in to comment.