-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
光弘
committed
Sep 6, 2018
1 parent
9a44d67
commit 39ddcfd
Showing
34 changed files
with
1,203 additions
and
432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# 高级使用 | ||
|
||
- order: 1 | ||
|
||
--- | ||
|
||
````jsx | ||
import classnames from 'classnames';; | ||
import { Card, Icon, Form } from 'uxcore'; | ||
|
||
const { SwitchFormField, FormRow } = Form; | ||
|
||
class Demo extends React.Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
value: { | ||
showCollapseIcon: false, | ||
showIcon: false, | ||
hasContentPadding: true, | ||
showTip: false, | ||
} | ||
}; | ||
} | ||
|
||
render() { | ||
const { showCollapseIcon, showIcon, hasContentPadding, showTip } = this.state.value; | ||
const cardProps = { | ||
title: 'Title Title Title Title Title', | ||
tip: showTip ? '这是一个提示' : '', | ||
icon: showIcon ? <Icon usei name="shangchuan" /> : null, | ||
extra: ( | ||
<a> | ||
自定义操作 | ||
</a> | ||
), | ||
className: 'card-demo', | ||
showCollapseIcon, | ||
contentPaddingSize: hasContentPadding ? 'middle' : 'none', | ||
}; | ||
return ( | ||
<div> | ||
<Form className="card-demo-form" jsxvalues={this.state.value} jsxonChange={(value) => { this.setState({ value }) }}> | ||
<FormRow> | ||
<SwitchFormField jsxname="showCollapseIcon" jsxlabel="开启折叠展开" /> | ||
<SwitchFormField jsxname="showIcon" jsxlabel="显示图标" /> | ||
</FormRow> | ||
<FormRow> | ||
<SwitchFormField jsxname="hasContentPadding" jsxlabel="包含内容边距" /> | ||
<SwitchFormField jsxname="showTip" jsxlabel="显示提示信息" /> | ||
</FormRow> | ||
</Form> | ||
<Card | ||
{...cardProps} | ||
> | ||
<p>Card content</p> | ||
<p>Card content</p> | ||
<p>Card content</p> | ||
</Card> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
ReactDOM.render( | ||
<Demo /> | ||
, document.getElementById('components-card-demo-advanced')); | ||
|
||
```` | ||
|
||
````css | ||
.code-box-demo { | ||
background: rgba(31, 56, 88, 0.3); | ||
} | ||
|
||
.card-demo { | ||
width: 300px; | ||
} | ||
|
||
.card-demo-form { | ||
width: 500px; | ||
} | ||
|
||
```` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# 基本使用 | ||
|
||
- order: 0 | ||
|
||
--- | ||
|
||
````jsx | ||
import classnames from 'classnames';; | ||
import { Card, Icon } from 'uxcore'; | ||
|
||
class Demo extends React.Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
}; | ||
} | ||
|
||
render() { | ||
const cardProps = { | ||
title: 'Title Title Title Title Title', | ||
tip: '这是一个提示', | ||
icon: <Icon usei name="shangchuan" />, | ||
extra: ( | ||
<a> | ||
自定义操作 | ||
</a> | ||
), | ||
className: 'card-demo', | ||
showCollapseIcon: true, | ||
contentPaddingSize: 'none', | ||
}; | ||
return ( | ||
<Card | ||
title="Card title" | ||
extra={<a href="#">More</a>} | ||
className="card-demo" | ||
> | ||
<p>Card content</p> | ||
<p>Card content</p> | ||
<p>Card content</p> | ||
</Card> | ||
); | ||
} | ||
} | ||
|
||
ReactDOM.render( | ||
<Demo /> | ||
, document.getElementById('components-card-demo-basic')); | ||
|
||
```` | ||
|
||
````css | ||
.code-box-demo { | ||
background: rgba(31, 56, 88, 0.3); | ||
} | ||
|
||
.card-demo { | ||
width: 300px; | ||
} | ||
|
||
```` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Card | ||
|
||
- category: Components | ||
- chinese: 卡片 | ||
- subtype: Presentation | ||
|
||
--- | ||
|
||
## Props | ||
|
||
| Name | Type | Required | Default | Comments | | ||
|---|---|---|---|---| | ||
| prefixCls | String | No | - | 类名前缀 | | ||
| className | String | No | - | 额外类名 | | ||
| icon | React Element | No | - | 头部图标 | | ||
| title | React Element | No | - | 头部标题 | | ||
| tip | React Element | No | - | 头部提示 | | ||
| extra | React Element | No | - | 头部右侧额外区域,通用用于放置动作 | | ||
| children | React Element | No | - | 卡片内容 | | ||
| showCollapseIcon | Bool | No | false | 显示折叠按钮 | | ||
| onCollapseChange | func(collapse) | No | noop | 折叠状态发生改变时的回调,参数为是否被折叠 | | ||
| contentPaddingSize | string | No | 'middle' | 内容区间距,枚举值:middle/none | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
- category: Components | ||
- chinese: At组件 | ||
- order: 9 | ||
- subtype: Other | ||
- subtype: Form Control | ||
|
||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.