diff --git a/src/guide/class-and-style.md b/src/guide/class-and-style.md index c092c6f87..31e159118 100644 --- a/src/guide/class-and-style.md +++ b/src/guide/class-and-style.md @@ -109,6 +109,44 @@ data: {
``` +### 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: '

Hi

' +}) +``` + +Then add some classes when using it: + +``` html + +``` + +The rendered HTML will be: + +``` html +

Hi

+``` + +The same is true for class bindings: + +``` html + +``` + +When `isActive` is truthy, the rendered HTML will be: + +``` html +
+``` + ## 绑定内联样式 ### 对象语法 diff --git a/src/guide/components.md b/src/guide/components.md index ec97318c9..2614c8e58 100644 --- a/src/guide/components.md +++ b/src/guide/components.md @@ -286,7 +286,7 @@ Vue.component('child', { ### 动态 Props -类似于用 `v-bind` 绑定 HTML 特性到一个表达式,也可以用 `v-bind` 绑定动态 props 到父组件的数据。每当父组件的数据变化时,也会传导给子组件: +类似于用 `v-bind` 绑定 HTML 特性到一个表达式,也可以用 `v-bind` 动态绑定 props 的值到父组件的数据中。每当父组件的数据变化时,该变化也会传导给子组件: ``` html
diff --git a/themes/vue/layout/partials/community_dropdown.ejs b/themes/vue/layout/partials/community_dropdown.ejs index 7f1936cb7..0c9d3edde 100644 --- a/themes/vue/layout/partials/community_dropdown.ejs +++ b/themes/vue/layout/partials/community_dropdown.ejs @@ -5,6 +5,6 @@
  • 论坛
  • 聊天室
  • Twitter
  • -
  • Jobs
  • +
  • Jobs