Skip to content

Commit

Permalink
docs: 组件的外部样式和全局样式 demo 代码 (#2579)
Browse files Browse the repository at this point in the history
  • Loading branch information
js-newbee authored and luckyadam committed Mar 26, 2019
1 parent 7076881 commit 0c26f07
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/component-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ button { } /* 在组件中不能使用 */

```jsx
/* CustomComp.js */
export default CustomComp extends Component {
export default class CustomComp extends Component {
static defaultProps = {
className: ''
}
Expand All @@ -45,7 +45,7 @@ export default CustomComp extends Component {

```jsx
/* MyPage.js */
export default MyPage extends Component {
export default class MyPage extends Component {
render () {
return <CustomComp className="red-text" />
}
Expand All @@ -63,7 +63,7 @@ export default MyPage extends Component {

```jsx
/* CustomComp.js */
export default CustomComp extends Component {
export default class CustomComp extends Component {
static externalClasses = ['my-class']

render () {
Expand All @@ -74,7 +74,7 @@ export default CustomComp extends Component {

```jsx
/* MyPage.js */
export default MyPage extends Component {
export default class MyPage extends Component {
render () {
return <CustomComp my-class="red-text" />
}
Expand All @@ -96,7 +96,7 @@ export default MyPage extends Component {

```jsx
/* CustomComp.js */
export default CustomComp extends Component {
export default class CustomComp extends Component {
static options = {
addGlobalClass: true
}
Expand Down

0 comments on commit 0c26f07

Please sign in to comment.