Commit ab35aa00 authored by 陈帅's avatar 陈帅

prettier md

parent cc5c8155
**/*.md
**/*.svg **/*.svg
package.json package.json
.umi .umi
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"singleQuote": true, "singleQuote": true,
"trailingComma": "es5", "trailingComma": "es5",
"printWidth": 100, "printWidth": 100,
"proseWrap": "never",
"overrides": [ "overrides": [
{ {
"files": ".prettierrc", "files": ".prettierrc",
......
...@@ -7,11 +7,13 @@ const getPrettierFiles = () => { ...@@ -7,11 +7,13 @@ const getPrettierFiles = () => {
const configFiles = glob.sync('config/**/*.js*', { ignore: ['**/node_modules/**', 'build/**'] }); const configFiles = glob.sync('config/**/*.js*', { ignore: ['**/node_modules/**', 'build/**'] });
const scriptFiles = glob.sync('scripts/**/*.js'); const scriptFiles = glob.sync('scripts/**/*.js');
const lessFiles = glob.sync('src/**/*.less*', { ignore: ['**/node_modules/**', 'build/**'] }); const lessFiles = glob.sync('src/**/*.less*', { ignore: ['**/node_modules/**', 'build/**'] });
const mdFiles = glob.sync('src/**/*.md*', { ignore: ['**/node_modules/**', 'build/**'] });
files = files.concat(jsFiles); files = files.concat(jsFiles);
files = files.concat(tsFiles); files = files.concat(tsFiles);
files = files.concat(configFiles); files = files.concat(configFiles);
files = files.concat(scriptFiles); files = files.concat(scriptFiles);
files = files.concat(lessFiles); files = files.concat(lessFiles);
files = files.concat(mdFiles);
if (!files.length) { if (!files.length) {
return; return;
} }
......
...@@ -18,6 +18,6 @@ ReactDOM.render( ...@@ -18,6 +18,6 @@ ReactDOM.render(
<Authorized authority={['user', 'admin']} noMatch={noMatch}> <Authorized authority={['user', 'admin']} noMatch={noMatch}>
<Alert message="Use Array as a parameter passed!" type="success" showIcon /> <Alert message="Use Array as a parameter passed!" type="success" showIcon />
</Authorized>, </Authorized>,
mountNode, mountNode
); );
``` ```
...@@ -20,12 +20,8 @@ const havePermission = () => { ...@@ -20,12 +20,8 @@ const havePermission = () => {
ReactDOM.render( ReactDOM.render(
<Authorized authority={havePermission} noMatch={noMatch}> <Authorized authority={havePermission} noMatch={noMatch}>
<Alert <Alert message="Use Function as a parameter passed!" type="success" showIcon />
message="Use Function as a parameter passed!"
type="success"
showIcon
/>
</Authorized>, </Authorized>,
mountNode, mountNode
); );
``` ```
...@@ -20,6 +20,6 @@ ReactDOM.render( ...@@ -20,6 +20,6 @@ ReactDOM.render(
<Alert message="user Passed!" type="success" showIcon /> <Alert message="user Passed!" type="success" showIcon />
</Authorized> </Authorized>
</div>, </div>,
mountNode, mountNode
); );
``` ```
...@@ -16,15 +16,13 @@ const { Secured } = RenderAuthorized('user'); ...@@ -16,15 +16,13 @@ const { Secured } = RenderAuthorized('user');
@Secured('admin') @Secured('admin')
class TestSecuredString extends React.Component { class TestSecuredString extends React.Component {
render() { render() {
return ( return <Alert message="user Passed!" type="success" showIcon />;
<Alert message="user Passed!" type="success" showIcon />
)
} }
} }
ReactDOM.render( ReactDOM.render(
<div> <div>
<TestSecuredString /> <TestSecuredString />
</div>, </div>,
mountNode, mountNode
); );
``` ```
...@@ -15,13 +15,12 @@ order: 15 ...@@ -15,13 +15,12 @@ order: 15
权限组件默认 export RenderAuthorized 函数,它接收当前权限作为参数,返回一个权限对象,该对象提供以下几种使用方式。 权限组件默认 export RenderAuthorized 函数,它接收当前权限作为参数,返回一个权限对象,该对象提供以下几种使用方式。
### Authorized ### Authorized
最基础的权限控制。 最基础的权限控制。
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | --- | --- | --- | --- |
| children | 正常渲染的元素,权限判断通过时展示 | ReactNode | - | | children | 正常渲染的元素,权限判断通过时展示 | ReactNode | - |
| authority | 准入权限/权限判断 | `string | array | Promise | (currentAuthority) => boolean | Promise` | - | | authority | 准入权限/权限判断 | `string | array | Promise | (currentAuthority) => boolean | Promise` | - |
| noMatch | 权限异常渲染元素,权限判断不通过时展示 | ReactNode | - | | noMatch | 权限异常渲染元素,权限判断不通过时展示 | ReactNode | - |
...@@ -29,7 +28,7 @@ order: 15 ...@@ -29,7 +28,7 @@ order: 15
### Authorized.AuthorizedRoute ### Authorized.AuthorizedRoute
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | --- | --- | --- | --- |
| authority | 准入权限/权限判断 | `string | array | Promise | (currentAuthority) => boolean | Promise` | - | | authority | 准入权限/权限判断 | `string | array | Promise | (currentAuthority) => boolean | Promise` | - |
| redirectPath | 权限异常时重定向的页面路由 | string | - | | redirectPath | 权限异常时重定向的页面路由 | string | - |
...@@ -40,17 +39,16 @@ order: 15 ...@@ -40,17 +39,16 @@ order: 15
注解方式,`@Authorized.Secured(authority, error)` 注解方式,`@Authorized.Secured(authority, error)`
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | --- | --- | --- | --- |
| authority | 准入权限/权限判断 | `string | Promise | (currentAuthority) => boolean | Promise` | - | | authority | 准入权限/权限判断 | `string | Promise | (currentAuthority) => boolean | Promise` | - |
| error | 权限异常时渲染元素 | ReactNode | <Exception type="403" /> | | error | 权限异常时渲染元素 | ReactNode | <Exception type="403" /> |
### Authorized.check ### Authorized.check
函数形式的 Authorized,用于某些不能被 HOC 包裹的组件。 `Authorized.check(authority, target, Exception)` 函数形式的 Authorized,用于某些不能被 HOC 包裹的组件。 `Authorized.check(authority, target, Exception)` 注意:传入一个 Promise 时,无论正确还是错误返回的都是一个 ReactClass。
注意:传入一个 Promise 时,无论正确还是错误返回的都是一个 ReactClass。
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | --- | --- | --- | --- |
| authority | 准入权限/权限判断 | `string | Promise | (currentAuthority) => boolean | Promise` | - | | authority | 准入权限/权限判断 | `string | Promise | (currentAuthority) => boolean | Promise` | - |
| target | 权限判断通过时渲染的元素 | ReactNode | - | | target | 权限判断通过时渲染的元素 | ReactNode | - |
| Exception | 权限异常时渲染元素 | ReactNode | - | | Exception | 权限异常时渲染元素 | ReactNode | - |
...@@ -5,20 +5,42 @@ title: ...@@ -5,20 +5,42 @@ title:
en-US: Max Items to Show en-US: Max Items to Show
--- ---
`maxLength` attribute specifies the maximum number of items to show while `excessItemsStyle` style the excess `maxLength` attribute specifies the maximum number of items to show while `excessItemsStyle` style the excess item component.
item component.
````jsx ```jsx
import AvatarList from 'ant-design-pro/lib/AvatarList'; import AvatarList from 'ant-design-pro/lib/AvatarList';
ReactDOM.render( ReactDOM.render(
<AvatarList size="mini" maxLength={3} excessItemsStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}> <AvatarList
<AvatarList.Item tips="Jake" src="https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png" /> size="mini"
<AvatarList.Item tips="Andy" src="https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png" /> maxLength={3}
<AvatarList.Item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" /> excessItemsStyle={{ color: '#f56a00', backgroundColor: '#fde3cf' }}
<AvatarList.Item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" /> >
<AvatarList.Item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" /> <AvatarList.Item
<AvatarList.Item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" /> tips="Jake"
</AvatarList> src="https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png"
, mountNode); />
```` <AvatarList.Item
tips="Andy"
src="https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png"
/>
<AvatarList.Item
tips="Niko"
src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png"
/>
<AvatarList.Item
tips="Niko"
src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png"
/>
<AvatarList.Item
tips="Niko"
src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png"
/>
<AvatarList.Item
tips="Niko"
src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png"
/>
</AvatarList>,
mountNode
);
```
...@@ -7,14 +7,24 @@ title: ...@@ -7,14 +7,24 @@ title:
Simplest of usage. Simplest of usage.
````jsx ```jsx
import AvatarList from 'ant-design-pro/lib/AvatarList'; import AvatarList from 'ant-design-pro/lib/AvatarList';
ReactDOM.render( ReactDOM.render(
<AvatarList size="mini"> <AvatarList size="mini">
<AvatarList.Item tips="Jake" src="https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png" /> <AvatarList.Item
<AvatarList.Item tips="Andy" src="https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png" /> tips="Jake"
<AvatarList.Item tips="Niko" src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png" /> src="https://gw.alipayobjects.com/zos/rmsportal/zOsKZmFRdUtvpqCImOVY.png"
</AvatarList> />
, mountNode); <AvatarList.Item
```` tips="Andy"
src="https://gw.alipayobjects.com/zos/rmsportal/sfjbOqnsXXJgNCjCzDBL.png"
/>
<AvatarList.Item
tips="Niko"
src="https://gw.alipayobjects.com/zos/rmsportal/kZzEzemZyKLKFsojXItE.png"
/>
</AvatarList>,
mountNode
);
```
...@@ -11,7 +11,7 @@ A list of user's avatar for project or group member list frequently. If a large ...@@ -11,7 +11,7 @@ A list of user's avatar for project or group member list frequently. If a large
### AvatarList ### AvatarList
| Property | Description | Type | Default | | Property | Description | Type | Default |
| ---------------- | --------------------- | ---------------------------------- | --------- | | ---------------- | --------------------- | ------------------------------------ | --------- |
| size | size of list | `large``small``mini`, `default` | `default` | | size | size of list | `large``small``mini`, `default` | `default` |
| maxLength | max items to show | number | - | | maxLength | max items to show | number | - |
| excessItemsStyle | the excess item style | CSSProperties | - | | excessItemsStyle | the excess item style | CSSProperties | - |
......
...@@ -12,7 +12,7 @@ cols: 1 ...@@ -12,7 +12,7 @@ cols: 1
### AvatarList ### AvatarList
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
| ---------------- | -------- | ---------------------------------- | --------- | | ---------------- | ---------------- | ------------------------------------ | --------- |
| size | 头像大小 | `large``small``mini`, `default` | `default` | | size | 头像大小 | `large``small``mini`, `default` | `default` |
| maxLength | 要显示的最大项目 | number | - | | maxLength | 要显示的最大项目 | number | - |
| excessItemsStyle | 多余的项目风格 | CSSProperties | - | | excessItemsStyle | 多余的项目风格 | CSSProperties | - |
...@@ -20,6 +20,6 @@ cols: 1 ...@@ -20,6 +20,6 @@ cols: 1
### AvatarList.Item ### AvatarList.Item
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
| ---- | ------ | --------- | --- | | ---- | ------------ | --------- | ------ |
| tips | 头像展示文案 | ReactNode | - | | tips | 头像展示文案 | ReactNode | - |
| src | 头像图片连接 | string | - | | src | 头像图片连接 | string | - |
...@@ -5,7 +5,7 @@ title: 柱状图 ...@@ -5,7 +5,7 @@ title: 柱状图
通过设置 `x``y` 属性,可以快速的构建出一个漂亮的柱状图,各种纬度的关系则是通过自定义的数据展现。 通过设置 `x``y` 属性,可以快速的构建出一个漂亮的柱状图,各种纬度的关系则是通过自定义的数据展现。
````jsx ```jsx
import { Bar } from 'ant-design-pro/lib/Charts'; import { Bar } from 'ant-design-pro/lib/Charts';
const salesData = []; const salesData = [];
...@@ -16,11 +16,5 @@ for (let i = 0; i < 12; i += 1) { ...@@ -16,11 +16,5 @@ for (let i = 0; i < 12; i += 1) {
}); });
} }
ReactDOM.render( ReactDOM.render(<Bar height={200} title="销售额趋势" data={salesData} />, mountNode);
<Bar ```
height={200}
title="销售额趋势"
data={salesData}
/>
, mountNode);
````
...@@ -21,26 +21,19 @@ ReactDOM.render( ...@@ -21,26 +21,19 @@ ReactDOM.render(
<Icon type="info-circle-o" /> <Icon type="info-circle-o" />
</Tooltip> </Tooltip>
} }
total={() => ( total={() => <span dangerouslySetInnerHTML={{ __html: yuan(126560) }} />}
<span dangerouslySetInnerHTML={{ __html: yuan(126560) }} /> footer={<Field label="日均销售额" value={numeral(12423).format('0,0')} />}
)}
footer={
<Field label="日均销售额" value={numeral(12423).format("0,0")} />
}
contentHeight={46} contentHeight={46}
> >
<span> <span>
周同比 周同比
<Trend flag="up" style={{ marginLeft: 8, color: "rgba(0,0,0,.85)" }}> <Trend flag="up" style={{ marginLeft: 8, color: 'rgba(0,0,0,.85)' }}>
12% 12%
</Trend> </Trend>
</span> </span>
<span style={{ marginLeft: 16 }}> <span style={{ marginLeft: 16 }}>
日环比 日环比
<Trend <Trend flag="down" style={{ marginLeft: 8, color: 'rgba(0,0,0,.85)' }}>
flag="down"
style={{ marginLeft: 8, color: "rgba(0,0,0,.85)" }}
>
11% 11%
</Trend> </Trend>
</span> </span>
...@@ -61,12 +54,8 @@ ReactDOM.render( ...@@ -61,12 +54,8 @@ ReactDOM.render(
<Icon type="info-circle-o" /> <Icon type="info-circle-o" />
</Tooltip> </Tooltip>
} }
total={() => ( total={() => <span dangerouslySetInnerHTML={{ __html: yuan(126560) }} />}
<span dangerouslySetInnerHTML={{ __html: yuan(126560) }} /> footer={<Field label="日均销售额" value={numeral(12423).format('0,0')} />}
)}
footer={
<Field label="日均销售额" value={numeral(12423).format("0,0")} />
}
/> />
</Col> </Col>
<Col span={24} style={{ marginTop: 24 }}> <Col span={24} style={{ marginTop: 24 }}>
...@@ -84,12 +73,10 @@ ReactDOM.render( ...@@ -84,12 +73,10 @@ ReactDOM.render(
<Icon type="info-circle-o" /> <Icon type="info-circle-o" />
</Tooltip> </Tooltip>
} }
total={() => ( total={() => <span dangerouslySetInnerHTML={{ __html: yuan(126560) }} />}
<span dangerouslySetInnerHTML={{ __html: yuan(126560) }} />
)}
/> />
</Col> </Col>
</Row>, </Row>,
mountNode, mountNode
); );
``` ```
...@@ -5,14 +5,8 @@ title: 仪表盘 ...@@ -5,14 +5,8 @@ title: 仪表盘
仪表盘是一种进度展示方式,可以更直观的展示当前的进展情况,通常也可表示占比。 仪表盘是一种进度展示方式,可以更直观的展示当前的进展情况,通常也可表示占比。
````jsx ```jsx
import { Gauge } from 'ant-design-pro/lib/Charts'; import { Gauge } from 'ant-design-pro/lib/Charts';
ReactDOM.render( ReactDOM.render(<Gauge title="核销率" height={164} percent={87} />, mountNode);
<Gauge ```
title="核销率"
height={164}
percent={87}
/>
, mountNode);
````
...@@ -4,7 +4,7 @@ col: 2 ...@@ -4,7 +4,7 @@ col: 2
title: 迷你区域图 title: 迷你区域图
--- ---
````jsx ```jsx
import { MiniArea } from 'ant-design-pro/lib/Charts'; import { MiniArea } from 'ant-design-pro/lib/Charts';
import moment from 'moment'; import moment from 'moment';
...@@ -12,17 +12,10 @@ const visitData = []; ...@@ -12,17 +12,10 @@ const visitData = [];
const beginDay = new Date().getTime(); const beginDay = new Date().getTime();
for (let i = 0; i < 20; i += 1) { for (let i = 0; i < 20; i += 1) {
visitData.push({ visitData.push({
x: moment(new Date(beginDay + (1000 * 60 * 60 * 24 * i))).format('YYYY-MM-DD'), x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
y: Math.floor(Math.random() * 100) + 10, y: Math.floor(Math.random() * 100) + 10,
}); });
} }
ReactDOM.render( ReactDOM.render(<MiniArea line color="#cceafe" height={45} data={visitData} />, mountNode);
<MiniArea ```
line
color="#cceafe"
height={45}
data={visitData}
/>
, mountNode);
````
...@@ -6,7 +6,7 @@ title: 迷你柱状图 ...@@ -6,7 +6,7 @@ title: 迷你柱状图
迷你柱状图更适合展示简单的区间数据,简洁的表现方式可以很好的减少大数据量的视觉展现压力。 迷你柱状图更适合展示简单的区间数据,简洁的表现方式可以很好的减少大数据量的视觉展现压力。
````jsx ```jsx
import { MiniBar } from 'ant-design-pro/lib/Charts'; import { MiniBar } from 'ant-design-pro/lib/Charts';
import moment from 'moment'; import moment from 'moment';
...@@ -14,15 +14,10 @@ const visitData = []; ...@@ -14,15 +14,10 @@ const visitData = [];
const beginDay = new Date().getTime(); const beginDay = new Date().getTime();
for (let i = 0; i < 20; i += 1) { for (let i = 0; i < 20; i += 1) {
visitData.push({ visitData.push({
x: moment(new Date(beginDay + (1000 * 60 * 60 * 24 * i))).format('YYYY-MM-DD'), x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
y: Math.floor(Math.random() * 100) + 10, y: Math.floor(Math.random() * 100) + 10,
}); });
} }
ReactDOM.render( ReactDOM.render(<MiniBar height={45} data={visitData} />, mountNode);
<MiniBar ```
height={45}
data={visitData}
/>
, mountNode);
````
...@@ -3,14 +3,10 @@ order: 6 ...@@ -3,14 +3,10 @@ order: 6
title: 迷你饼状图 title: 迷你饼状图
--- ---
通过简化 `Pie` 属性的设置,可以快速的实现极简的饼状图,可配合 `ChartCard` 组合展 通过简化 `Pie` 属性的设置,可以快速的实现极简的饼状图,可配合 `ChartCard` 组合展现更多业务场景。
现更多业务场景。
```jsx ```jsx
import { Pie } from 'ant-design-pro/lib/Charts'; import { Pie } from 'ant-design-pro/lib/Charts';
ReactDOM.render( ReactDOM.render(<Pie percent={28} subTitle="中式快餐" total="28%" height={140} />, mountNode);
<Pie percent={28} subTitle="中式快餐" total="28%" height={140} />,
mountNode
);
``` ```
...@@ -3,10 +3,8 @@ order: 3 ...@@ -3,10 +3,8 @@ order: 3
title: 迷你进度条 title: 迷你进度条
--- ---
````jsx ```jsx
import { MiniProgress } from 'ant-design-pro/lib/Charts'; import { MiniProgress } from 'ant-design-pro/lib/Charts';
ReactDOM.render( ReactDOM.render(<MiniProgress percent={78} strokeWidth={8} target={80} />, mountNode);
<MiniProgress percent={78} strokeWidth={8} target={80} /> ```
, mountNode);
````
...@@ -5,7 +5,7 @@ title: 图表套件组合展示 ...@@ -5,7 +5,7 @@ title: 图表套件组合展示
利用 Ant Design Pro 提供的图表套件,可以灵活组合符合设计规范的图表来满足复杂的业务需求。 利用 Ant Design Pro 提供的图表套件,可以灵活组合符合设计规范的图表来满足复杂的业务需求。
````jsx ```jsx
import { ChartCard, Field, MiniArea, MiniBar, MiniProgress } from 'ant-design-pro/lib/Charts'; import { ChartCard, Field, MiniArea, MiniBar, MiniProgress } from 'ant-design-pro/lib/Charts';
import Trend from 'ant-design-pro/lib/Trend'; import Trend from 'ant-design-pro/lib/Trend';
import NumberInfo from 'ant-design-pro/lib/NumberInfo'; import NumberInfo from 'ant-design-pro/lib/NumberInfo';
...@@ -17,7 +17,7 @@ const visitData = []; ...@@ -17,7 +17,7 @@ const visitData = [];
const beginDay = new Date().getTime(); const beginDay = new Date().getTime();
for (let i = 0; i < 20; i += 1) { for (let i = 0; i < 20; i += 1) {
visitData.push({ visitData.push({
x: moment(new Date(beginDay + (1000 * 60 * 60 * 24 * i))).format('YYYY-MM-DD'), x: moment(new Date(beginDay + 1000 * 60 * 60 * 24 * i)).format('YYYY-MM-DD'),
y: Math.floor(Math.random() * 100) + 10, y: Math.floor(Math.random() * 100) + 10,
}); });
} }
...@@ -25,52 +25,53 @@ for (let i = 0; i < 20; i += 1) { ...@@ -25,52 +25,53 @@ for (let i = 0; i < 20; i += 1) {
ReactDOM.render( ReactDOM.render(
<Row> <Row>
<Col span={24}> <Col span={24}>
<ChartCard <ChartCard title="搜索用户数量" total={numeral(8846).format('0,0')} contentHeight={134}>
title="搜索用户数量"
total={numeral(8846).format('0,0')}
contentHeight={134}
>
<NumberInfo <NumberInfo
subTitle={<span>本周访问</span>} subTitle={<span>本周访问</span>}
total={numeral(12321).format('0,0')} total={numeral(12321).format('0,0')}
status="up" status="up"
subTotal={17.1} subTotal={17.1}
/> />
<MiniArea <MiniArea line height={45} data={visitData} />
line
height={45}
data={visitData}
/>
</ChartCard> </ChartCard>
</Col> </Col>
<Col span={24} style={{ marginTop: 24 }}> <Col span={24} style={{ marginTop: 24 }}>
<ChartCard <ChartCard
title="访问量" title="访问量"
action={<Tooltip title="指标说明"><Icon type="info-circle-o" /></Tooltip>} action={
<Tooltip title="指标说明">
<Icon type="info-circle-o" />
</Tooltip>
}
total={numeral(8846).format('0,0')} total={numeral(8846).format('0,0')}
footer={<Field label="日访问量" value={numeral(1234).format('0,0')} />} footer={<Field label="日访问量" value={numeral(1234).format('0,0')} />}
contentHeight={46} contentHeight={46}
> >
<MiniBar <MiniBar height={46} data={visitData} />
height={46}
data={visitData}
/>
</ChartCard> </ChartCard>
</Col> </Col>
<Col span={24} style={{ marginTop: 24 }}> <Col span={24} style={{ marginTop: 24 }}>
<ChartCard <ChartCard
title="线上购物转化率" title="线上购物转化率"
action={<Tooltip title="指标说明"><Icon type="info-circle-o" /></Tooltip>} action={
<Tooltip title="指标说明">
<Icon type="info-circle-o" />
</Tooltip>
}
total="78%" total="78%"
footer={ footer={
<div> <div>
<span> <span>
周同比 周同比
<Trend flag="up" style={{ marginLeft: 8, color: 'rgba(0,0,0,.85)' }}>12%</Trend> <Trend flag="up" style={{ marginLeft: 8, color: 'rgba(0,0,0,.85)' }}>
12%
</Trend>
</span> </span>
<span style={{ marginLeft: 16 }}> <span style={{ marginLeft: 16 }}>
日环比 日环比
<Trend flag="down" style={{ marginLeft: 8, color: 'rgba(0,0,0,.85)' }}>11%</Trend> <Trend flag="down" style={{ marginLeft: 8, color: 'rgba(0,0,0,.85)' }}>
11%
</Trend>
</span> </span>
</div> </div>
} }
...@@ -79,6 +80,7 @@ ReactDOM.render( ...@@ -79,6 +80,7 @@ ReactDOM.render(
<MiniProgress percent={78} strokeWidth={8} target={80} /> <MiniProgress percent={78} strokeWidth={8} target={80} />
</ChartCard> </ChartCard>
</Col> </Col>
</Row> </Row>,
, mountNode); mountNode
```` );
```
...@@ -41,7 +41,7 @@ ReactDOM.render( ...@@ -41,7 +41,7 @@ ReactDOM.render(
total={() => ( total={() => (
<span <span
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: yuan(salesPieData.reduce((pre, now) => now.y + pre, 0)) __html: yuan(salesPieData.reduce((pre, now) => now.y + pre, 0)),
}} }}
/> />
)} )}
...@@ -49,6 +49,6 @@ ReactDOM.render( ...@@ -49,6 +49,6 @@ ReactDOM.render(
valueFormat={val => <span dangerouslySetInnerHTML={{ __html: yuan(val) }} />} valueFormat={val => <span dangerouslySetInnerHTML={{ __html: yuan(val) }} />}
height={294} height={294}
/>, />,
mountNode, mountNode
); );
``` ```
...@@ -3,7 +3,7 @@ order: 7 ...@@ -3,7 +3,7 @@ order: 7
title: 雷达图 title: 雷达图
--- ---
````jsx ```jsx
import { Radar, ChartCard } from 'ant-design-pro/lib/Charts'; import { Radar, ChartCard } from 'ant-design-pro/lib/Charts';
const radarOriginData = [ const radarOriginData = [
...@@ -40,8 +40,8 @@ const radarTitleMap = { ...@@ -40,8 +40,8 @@ const radarTitleMap = {
contribute: '贡献', contribute: '贡献',
hot: '热度', hot: '热度',
}; };
radarOriginData.forEach((item) => { radarOriginData.forEach(item => {
Object.keys(item).forEach((key) => { Object.keys(item).forEach(key => {
if (key !== 'name') { if (key !== 'name') {
radarData.push({ radarData.push({
name: item.name, name: item.name,
...@@ -54,11 +54,8 @@ radarOriginData.forEach((item) => { ...@@ -54,11 +54,8 @@ radarOriginData.forEach((item) => {
ReactDOM.render( ReactDOM.render(
<ChartCard title="数据比例"> <ChartCard title="数据比例">
<Radar <Radar hasLegend height={286} data={radarData} />
hasLegend </ChartCard>,
height={286} mountNode
data={radarData} );
/> ```
</ChartCard>
, mountNode);
````
...@@ -5,21 +5,16 @@ title: 标签云 ...@@ -5,21 +5,16 @@ title: 标签云
标签云是一套相关的标签以及与此相应的权重展示方式,一般典型的标签云有 30 至 150 个标签,而权重影响使用的字体大小或其他视觉效果。 标签云是一套相关的标签以及与此相应的权重展示方式,一般典型的标签云有 30 至 150 个标签,而权重影响使用的字体大小或其他视觉效果。
````jsx ```jsx
import { TagCloud } from 'ant-design-pro/lib/Charts'; import { TagCloud } from 'ant-design-pro/lib/Charts';
const tags = []; const tags = [];
for (let i = 0; i < 50; i += 1) { for (let i = 0; i < 50; i += 1) {
tags.push({ tags.push({
name: `TagClout-Title-${i}`, name: `TagClout-Title-${i}`,
value: Math.floor((Math.random() * 50)) + 20, value: Math.floor(Math.random() * 50) + 20,
}); });
} }
ReactDOM.render( ReactDOM.render(<TagCloud data={tags} height={200} />, mountNode);
<TagCloud ```
data={tags}
height={200}
/>
, mountNode);
````
...@@ -5,23 +5,20 @@ title: 带有时间轴的图表 ...@@ -5,23 +5,20 @@ title: 带有时间轴的图表
使用 `TimelineChart` 组件可以实现带有时间轴的柱状图展现,而其中的 `x` 属性,则是时间值的指向,默认最多支持同时展现两个指标,分别是 `y1``y2` 使用 `TimelineChart` 组件可以实现带有时间轴的柱状图展现,而其中的 `x` 属性,则是时间值的指向,默认最多支持同时展现两个指标,分别是 `y1``y2`
````jsx ```jsx
import { TimelineChart } from 'ant-design-pro/lib/Charts'; import { TimelineChart } from 'ant-design-pro/lib/Charts';
const chartData = []; const chartData = [];
for (let i = 0; i < 20; i += 1) { for (let i = 0; i < 20; i += 1) {
chartData.push({ chartData.push({
x: (new Date().getTime()) + (1000 * 60 * 30 * i), x: new Date().getTime() + 1000 * 60 * 30 * i,
y1: Math.floor(Math.random() * 100) + 1000, y1: Math.floor(Math.random() * 100) + 1000,
y2: Math.floor(Math.random() * 100) + 10, y2: Math.floor(Math.random() * 100) + 10,
}); });
} }
ReactDOM.render( ReactDOM.render(
<TimelineChart <TimelineChart height={200} data={chartData} titleMap={{ y1: '客流量', y2: '支付笔数' }} />,
height={200} mountNode
data={chartData} );
titleMap={{ y1: '客流量', y2: '支付笔数' }} ```
/>
, mountNode);
````
...@@ -5,16 +5,13 @@ title: 水波图 ...@@ -5,16 +5,13 @@ title: 水波图
水波图是一种比例的展示方式,可以更直观的展示关键值的占比。 水波图是一种比例的展示方式,可以更直观的展示关键值的占比。
````jsx ```jsx
import { WaterWave } from 'ant-design-pro/lib/Charts'; import { WaterWave } from 'ant-design-pro/lib/Charts';
ReactDOM.render( ReactDOM.render(
<div style={{ textAlign: 'center' }}> <div style={{ textAlign: 'center' }}>
<WaterWave <WaterWave height={161} title="补贴资金剩余" percent={34} />
height={161} </div>,
title="补贴资金剩余" mountNode
percent={34} );
/> ```
</div>
, mountNode);
````
...@@ -14,17 +14,18 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -14,17 +14,18 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
### ChartCard ### ChartCard
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | ------------- | ------------ | ------------------------------- | ------ |
| title | 卡片标题 | ReactNode\|string | - | | title | 卡片标题 | ReactNode\|string | - |
| action | 卡片操作 | ReactNode | - | | action | 卡片操作 | ReactNode | - |
| total | 数据总量 | ReactNode \| number \| function | - | | total | 数据总量 | ReactNode \| number \| function | - |
| footer | 卡片底部 | ReactNode | - | | footer | 卡片底部 | ReactNode | - |
| contentHeight | 内容区域高度 | number | - | | contentHeight | 内容区域高度 | number | - |
| avatar | 右侧图标 | React.ReactNode | - | | avatar | 右侧图标 | React.ReactNode | - |
### MiniBar ### MiniBar
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | ------ | -------- | ------------- | --------- |
| color | 图表颜色 | string | `#1890FF` | | color | 图表颜色 | string | `#1890FF` |
| height | 图表高度 | number | - | | height | 图表高度 | number | - |
| data | 数据 | array<{x, y}> | - | | data | 数据 | array<{x, y}> | - |
...@@ -32,7 +33,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -32,7 +33,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
### MiniArea ### MiniArea
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | --- | --- | --- | --- |
| color | 图表颜色 | string | `rgba(24, 144, 255, 0.2)` | | color | 图表颜色 | string | `rgba(24, 144, 255, 0.2)` |
| borderColor | 图表边颜色 | string | `#1890FF` | | borderColor | 图表边颜色 | string | `#1890FF` |
| height | 图表高度 | number | - | | height | 图表高度 | number | - |
...@@ -45,7 +46,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -45,7 +46,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
### MiniProgress ### MiniProgress
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | ----------- | ---------- | ------ | ------ |
| target | 目标比例 | number | - | | target | 目标比例 | number | - |
| color | 进度条颜色 | string | - | | color | 进度条颜色 | string | - |
| strokeWidth | 进度条高度 | number | - | | strokeWidth | 进度条高度 | number | - |
...@@ -54,7 +55,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -54,7 +55,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
### Bar ### Bar
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | --- | --- | --- | --- |
| title | 图表标题 | ReactNode\|string | - | | title | 图表标题 | ReactNode\|string | - |
| color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` | | color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` |
| padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` | | padding | 图表内部间距 | [array](https://github.com/alibaba/BizCharts/blob/master/doc/api/chart.md#7padding-object--number--array-) | `'auto'` |
...@@ -65,7 +66,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -65,7 +66,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
### Pie ### Pie
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | --- | --- | --- | --- |
| animate | 是否显示动画 | boolean | true | | animate | 是否显示动画 | boolean | true |
| color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` | | color | 图表颜色 | string | `rgba(24, 144, 255, 0.85)` |
| height | 图表高度 | number | - | | height | 图表高度 | number | - |
...@@ -81,7 +82,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -81,7 +82,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
### Radar ### Radar
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | --- | --- | --- | --- |
| title | 图表标题 | ReactNode\|string | - | | title | 图表标题 | ReactNode\|string | - |
| height | 图表高度 | number | - | | height | 图表高度 | number | - |
| hasLegend | 是否显示 legend | boolean | `false` | | hasLegend | 是否显示 legend | boolean | `false` |
...@@ -91,7 +92,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -91,7 +92,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
### Gauge ### Gauge
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | ------- | ------------ | ----------------- | --------- |
| title | 图表标题 | ReactNode\|string | - | | title | 图表标题 | ReactNode\|string | - |
| height | 图表高度 | number | - | | height | 图表高度 | number | - |
| color | 图表颜色 | string | `#2F9CFF` | | color | 图表颜色 | string | `#2F9CFF` |
...@@ -101,7 +102,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -101,7 +102,7 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
### WaterWave ### WaterWave
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | ------- | -------- | ----------------- | --------- |
| title | 图表标题 | ReactNode\|string | - | | title | 图表标题 | ReactNode\|string | - |
| height | 图表高度 | number | - | | height | 图表高度 | number | - |
| color | 图表颜色 | string | `#1890FF` | | color | 图表颜色 | string | `#1890FF` |
...@@ -110,14 +111,14 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -110,14 +111,14 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
### TagCloud ### TagCloud
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | ------ | ------ | ------------------- | ------ |
| data | 标题 | Array<name, value\> | - | | data | 标题 | Array<name, value\> | - |
| height | 高度值 | number | - | | height | 高度值 | number | - |
### TimelineChart ### TimelineChart
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | -------- | -------- | ------------------------------------ | ------ |
| data | 标题 | Array<x, y1, y2\> | - | | data | 标题 | Array<x, y1, y2\> | - |
| titleMap | 指标别名 | Object{y1: '客流量', y2: '支付笔数'} | - | | titleMap | 指标别名 | Object{y1: '客流量', y2: '支付笔数'} | - |
| height | 高度值 | number | 400 | | height | 高度值 | number | 400 |
...@@ -125,6 +126,6 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https ...@@ -125,6 +126,6 @@ Ant Design Pro 提供的业务中常用的图表类型,都是基于 [G2](https
### Field ### Field
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | ----- | ---- | ----------------- | ------ |
| label | 标题 | ReactNode\|string | - | | label | 标题 | ReactNode\|string | - |
| value | 值 | ReactNode\|string | - | | value | 值 | ReactNode\|string | - |
...@@ -13,12 +13,10 @@ title: ...@@ -13,12 +13,10 @@ title:
The simplest usage. The simplest usage.
````jsx ```jsx
import CountDown from 'ant-design-pro/lib/CountDown'; import CountDown from 'ant-design-pro/lib/CountDown';
const targetTime = new Date().getTime() + 3900000; const targetTime = new Date().getTime() + 3900000;
ReactDOM.render( ReactDOM.render(<CountDown style={{ fontSize: 20 }} target={targetTime} />, mountNode);
<CountDown style={{ fontSize: 20 }} target={targetTime} /> ```
, mountNode);
````
...@@ -9,7 +9,7 @@ Simple CountDown Component. ...@@ -9,7 +9,7 @@ Simple CountDown Component.
## API ## API
| Property | Description | Type | Default | | Property | Description | Type | Default |
|----------|------------------------------------------|-------------|-------| | -------- | ----------------------------- | -------------- | ------- |
| format | Formatter of time | Function(time) | | | format | Formatter of time | Function(time) | |
| target | Target time | Date | - | | target | Target time | Date | - |
| onEnd | Countdown to the end callback | funtion | -| | onEnd | Countdown to the end callback | funtion | - |
...@@ -10,7 +10,7 @@ order: 3 ...@@ -10,7 +10,7 @@ order: 3
## API ## API
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | ------ | -------------- | -------------- | ------ |
| format | 时间格式化显示 | Function(time) | | | format | 时间格式化显示 | Function(time) | |
| target | 目标时间 | Date | - | | target | 目标时间 | Date | - |
| onEnd | 倒计时结束回调 | funtion | -| | onEnd | 倒计时结束回调 | funtion | - |
...@@ -13,7 +13,7 @@ title: ...@@ -13,7 +13,7 @@ title:
Basic DescriptionList. Basic DescriptionList.
````jsx ```jsx
import DescriptionList from 'ant-design-pro/lib/DescriptionList'; import DescriptionList from 'ant-design-pro/lib/DescriptionList';
const { Description } = DescriptionList; const { Description } = DescriptionList;
...@@ -21,23 +21,18 @@ const { Description } = DescriptionList; ...@@ -21,23 +21,18 @@ const { Description } = DescriptionList;
ReactDOM.render( ReactDOM.render(
<DescriptionList size="large" title="title"> <DescriptionList size="large" title="title">
<Description term="Firefox"> <Description term="Firefox">
A free, open source, cross-platform, A free, open source, cross-platform, graphical web browser developed by the Mozilla
graphical web browser developed by the Corporation and hundreds of volunteers.
Mozilla Corporation and hundreds of
volunteers.
</Description> </Description>
<Description term="Firefox"> <Description term="Firefox">
A free, open source, cross-platform, A free, open source, cross-platform, graphical web browser developed by the Mozilla
graphical web browser developed by the Corporation and hundreds of volunteers.
Mozilla Corporation and hundreds of
volunteers.
</Description> </Description>
<Description term="Firefox"> <Description term="Firefox">
A free, open source, cross-platform, A free, open source, cross-platform, graphical web browser developed by the Mozilla
graphical web browser developed by the Corporation and hundreds of volunteers.
Mozilla Corporation and hundreds of
volunteers.
</Description> </Description>
</DescriptionList> </DescriptionList>,
, mountNode); mountNode
```` );
```
...@@ -13,7 +13,7 @@ title: ...@@ -13,7 +13,7 @@ title:
Vertical layout. Vertical layout.
````jsx ```jsx
import DescriptionList from 'ant-design-pro/lib/DescriptionList'; import DescriptionList from 'ant-design-pro/lib/DescriptionList';
const { Description } = DescriptionList; const { Description } = DescriptionList;
...@@ -21,23 +21,18 @@ const { Description } = DescriptionList; ...@@ -21,23 +21,18 @@ const { Description } = DescriptionList;
ReactDOM.render( ReactDOM.render(
<DescriptionList size="large" title="title" layout="vertical"> <DescriptionList size="large" title="title" layout="vertical">
<Description term="Firefox"> <Description term="Firefox">
A free, open source, cross-platform, A free, open source, cross-platform, graphical web browser developed by the Mozilla
graphical web browser developed by the Corporation and hundreds of volunteers.
Mozilla Corporation and hundreds of
volunteers.
</Description> </Description>
<Description term="Firefox"> <Description term="Firefox">
A free, open source, cross-platform, A free, open source, cross-platform, graphical web browser developed by the Mozilla
graphical web browser developed by the Corporation and hundreds of volunteers.
Mozilla Corporation and hundreds of
volunteers.
</Description> </Description>
<Description term="Firefox"> <Description term="Firefox">
A free, open source, cross-platform, A free, open source, cross-platform, graphical web browser developed by the Mozilla
graphical web browser developed by the Corporation and hundreds of volunteers.
Mozilla Corporation and hundreds of
volunteers.
</Description> </Description>
</DescriptionList> </DescriptionList>,
, mountNode); mountNode
```` );
```
...@@ -11,7 +11,7 @@ Groups display multiple read-only fields, which are common to informational disp ...@@ -11,7 +11,7 @@ Groups display multiple read-only fields, which are common to informational disp
### DescriptionList ### DescriptionList
| Property | Description | Type | Default | | Property | Description | Type | Default |
|----------|------------------------------------------|-------------|---------| | --- | --- | --- | --- |
| layout | type of layout | Enum{'horizontal', 'vertical'} | 'horizontal' | | layout | type of layout | Enum{'horizontal', 'vertical'} | 'horizontal' |
| col | specify the maximum number of columns to display, the final columns number is determined by col setting combined with [Responsive Rules](/components/DescriptionList#Responsive-Rules) | number(0 < col <= 4) | 3 | | col | specify the maximum number of columns to display, the final columns number is determined by col setting combined with [Responsive Rules](/components/DescriptionList#Responsive-Rules) | number(0 < col <= 4) | 3 |
| title | title | ReactNode | - | | title | title | ReactNode | - |
...@@ -21,7 +21,7 @@ Groups display multiple read-only fields, which are common to informational disp ...@@ -21,7 +21,7 @@ Groups display multiple read-only fields, which are common to informational disp
#### Responsive Rules #### Responsive Rules
| Window Width | Columns Number | | Window Width | Columns Number |
|---------------------|---------------------------------------------| | ------------ | ------------------- |
| `≥768px` | `col` | | `≥768px` | `col` |
| `≥576px` | `col < 2 ? col : 2` | | `≥576px` | `col < 2 ? col : 2` |
| `<576px` | `1` | | `<576px` | `1` |
...@@ -29,5 +29,5 @@ Groups display multiple read-only fields, which are common to informational disp ...@@ -29,5 +29,5 @@ Groups display multiple read-only fields, which are common to informational disp
### DescriptionList.Description ### DescriptionList.Description
| Property | Description | Type | Default | | Property | Description | Type | Default |
|----------|------------------------------------------|-------------|-------| | -------- | ----------- | --------- | ------- |
| term | item title | ReactNode | - | | term | item title | ReactNode | - |
...@@ -12,7 +12,7 @@ order: 4 ...@@ -12,7 +12,7 @@ order: 4
### DescriptionList ### DescriptionList
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | --- | --- | --- | --- |
| layout | 布局方式 | Enum{'horizontal', 'vertical'} | 'horizontal' | | layout | 布局方式 | Enum{'horizontal', 'vertical'} | 'horizontal' |
| col | 指定信息最多分几列展示,最终一行几列由 col 配置结合[响应式规则](/components/DescriptionList#响应式规则)决定 | number(0 < col <= 4) | 3 | | col | 指定信息最多分几列展示,最终一行几列由 col 配置结合[响应式规则](/components/DescriptionList#响应式规则)决定 | number(0 < col <= 4) | 3 |
| title | 列表标题 | ReactNode | - | | title | 列表标题 | ReactNode | - |
...@@ -22,7 +22,7 @@ order: 4 ...@@ -22,7 +22,7 @@ order: 4
#### 响应式规则 #### 响应式规则
| 窗口宽度 | 展示列数 | | 窗口宽度 | 展示列数 |
|---------------------|---------------------------------------------| | -------- | ------------------- |
| `≥768px` | `col` | | `≥768px` | `col` |
| `≥576px` | `col < 2 ? col : 2` | | `≥576px` | `col < 2 ? col : 2` |
| `<576px` | `1` | | `<576px` | `1` |
...@@ -30,8 +30,5 @@ order: 4 ...@@ -30,8 +30,5 @@ order: 4
### DescriptionList.Description ### DescriptionList.Description
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | ---- | ---------- | --------- | ------ |
| term | 列表项标题 | ReactNode | - | | term | 列表项标题 | ReactNode | - |
...@@ -17,15 +17,23 @@ title: ...@@ -17,15 +17,23 @@ title:
Also note that, in this mode, the outer container needs to have a specified width (or set its own width). Also note that, in this mode, the outer container needs to have a specified width (or set its own width).
```jsx
````jsx
import Ellipsis from 'ant-design-pro/lib/Ellipsis'; import Ellipsis from 'ant-design-pro/lib/Ellipsis';
const article = <p>There were injuries alleged in three <a href="#cover">cases in 2015</a>, and a fourth incident in September, according to the safety recall report. After meeting with US regulators in October, the firm decided to issue a voluntary recall.</p>; const article = (
<p>
There were injuries alleged in three <a href="#cover">cases in 2015</a>, and a fourth incident
in September, according to the safety recall report. After meeting with US regulators in
October, the firm decided to issue a voluntary recall.
</p>
);
ReactDOM.render( ReactDOM.render(
<div style={{ width: 200 }}> <div style={{ width: 200 }}>
<Ellipsis tooltip lines={3}>{article}</Ellipsis> <Ellipsis tooltip lines={3}>
</div> {article}
, mountNode); </Ellipsis>
```` </div>,
mountNode
);
```
...@@ -13,16 +13,20 @@ title: ...@@ -13,16 +13,20 @@ title:
`length` attribute specifies the maximum length where the text will automatically be truncated when exceeded. `length` attribute specifies the maximum length where the text will automatically be truncated when exceeded.
````jsx ```jsx
import Ellipsis from 'ant-design-pro/lib/Ellipsis'; import Ellipsis from 'ant-design-pro/lib/Ellipsis';
const article = 'There were injuries alleged in three cases in 2015, and a fourth incident in September, according to the safety recall report. After meeting with US regulators in October, the firm decided to issue a voluntary recall.'; const article =
'There were injuries alleged in three cases in 2015, and a fourth incident in September, according to the safety recall report. After meeting with US regulators in October, the firm decided to issue a voluntary recall.';
ReactDOM.render( ReactDOM.render(
<div> <div>
<Ellipsis length={100}>{article}</Ellipsis> <Ellipsis length={100}>{article}</Ellipsis>
<h4 style={{ marginTop: 24 }}>Show Tooltip</h4> <h4 style={{ marginTop: 24 }}>Show Tooltip</h4>
<Ellipsis length={100} tooltip>{article}</Ellipsis> <Ellipsis length={100} tooltip>
</div> {article}
, mountNode); </Ellipsis>
```` </div>,
mountNode
);
```
...@@ -8,9 +8,9 @@ When the text is too long, the Ellipsis automatically shortens it according to i ...@@ -8,9 +8,9 @@ When the text is too long, the Ellipsis automatically shortens it according to i
## API ## API
Property | Description | Type | Default | Property | Description | Type | Default |
----|------|-----|------ | --- | --- | --- | --- |
tooltip | tooltip for showing the full text content when hovering over | boolean | - | tooltip | tooltip for showing the full text content when hovering over | boolean | - |
length | maximum number of characters in the text before being truncated | number | - | length | maximum number of characters in the text before being truncated | number | - |
lines | maximum number of rows in the text before being truncated | number | `1` | lines | maximum number of rows in the text before being truncated | number | `1` |
fullWidthRecognition | whether consider full-width character length as 2 when calculate string length | boolean | - | fullWidthRecognition | whether consider full-width character length as 2 when calculate string length | boolean | - |
...@@ -9,9 +9,9 @@ order: 10 ...@@ -9,9 +9,9 @@ order: 10
## API ## API
参数 | 说明 | 类型 | 默认值 | 参数 | 说明 | 类型 | 默认值 |
----|------|-----|------ | -------------------- | ------------------------------------------------ | ------- | ------ |
tooltip | 移动到文本展示完整内容的提示 | boolean | - | tooltip | 移动到文本展示完整内容的提示 | boolean | - |
length | 在按照长度截取下的文本最大字符数,超过则截取省略 | number | - | length | 在按照长度截取下的文本最大字符数,超过则截取省略 | number | - |
lines | 在按照行数截取下最大的行数,超过则截取省略 | number | `1` | lines | 在按照行数截取下最大的行数,超过则截取省略 | number | `1` |
fullWidthRecognition | 是否将全角字符的长度视为2来计算字符串长度 | boolean | - | fullWidthRecognition | 是否将全角字符的长度视为 2 来计算字符串长度 | boolean | - |
...@@ -13,7 +13,7 @@ title: ...@@ -13,7 +13,7 @@ title:
403 page with custom operations. 403 page with custom operations.
````jsx ```jsx
import Exception from 'ant-design-pro/lib/Exception'; import Exception from 'ant-design-pro/lib/Exception';
import { Button } from 'antd'; import { Button } from 'antd';
...@@ -23,7 +23,5 @@ const actions = ( ...@@ -23,7 +23,5 @@ const actions = (
<Button>Detail</Button> <Button>Detail</Button>
</div> </div>
); );
ReactDOM.render( ReactDOM.render(<Exception type="403" actions={actions} />, mountNode);
<Exception type="403" actions={actions} /> ```
, mountNode);
````
...@@ -13,10 +13,8 @@ title: ...@@ -13,10 +13,8 @@ title:
404 page. 404 page.
````jsx ```jsx
import Exception from 'ant-design-pro/lib/Exception'; import Exception from 'ant-design-pro/lib/Exception';
ReactDOM.render( ReactDOM.render(<Exception type="404" />, mountNode);
<Exception type="404" /> ```
, mountNode);
````
...@@ -13,10 +13,8 @@ title: ...@@ -13,10 +13,8 @@ title:
500 page. 500 page.
````jsx ```jsx
import Exception from 'ant-design-pro/lib/Exception'; import Exception from 'ant-design-pro/lib/Exception';
ReactDOM.render( ReactDOM.render(<Exception type="500" />, mountNode);
<Exception type="500" /> ```
, mountNode);
````
...@@ -8,13 +8,13 @@ Exceptions page is used to provide feedback on specific abnormal state. Usually, ...@@ -8,13 +8,13 @@ Exceptions page is used to provide feedback on specific abnormal state. Usually,
## API ## API
Property | Description | Type | Default | Property | Description | Type | Default |
---------|-------------|------|-------- | --- | --- | --- | --- |
| backText | default return button text | ReactNode | back to home | | backText | default return button text | ReactNode | back to home |
type | type of exception, the corresponding default `title`, `desc`, `img` will be given if set, which can be overridden by explicit setting of `title`, `desc`, `img` | Enum {'403', '404', '500'} | - | type | type of exception, the corresponding default `title`, `desc`, `img` will be given if set, which can be overridden by explicit setting of `title`, `desc`, `img` | Enum {'403', '404', '500'} | - |
title | title | ReactNode | - | title | title | ReactNode | - |
desc | supplementary description | ReactNode | - | desc | supplementary description | ReactNode | - |
img | the url of background image | string | - | img | the url of background image | string | - |
actions | suggested operations, a default 'Home' link will show if not set | ReactNode | - | actions | suggested operations, a default 'Home' link will show if not set | ReactNode | - |
linkElement | to specify the element of link | string\|ReactElement | 'a' | linkElement | to specify the element of link | string\|ReactElement | 'a' |
redirect | redirect path | string | '/' | redirect | redirect path | string | '/' |
\ No newline at end of file
...@@ -9,13 +9,13 @@ order: 5 ...@@ -9,13 +9,13 @@ order: 5
## API ## API
| 参数 | 说明| 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|-------------|------------------------------------------|-------------|-------| | --- | --- | --- | --- |
| backText| 默认的返回按钮文本 | ReactNode| back to home | | backText | 默认的返回按钮文本 | ReactNode | back to home |
| type| 页面类型,若配置,则自带对应类型默认的 `title``desc``img`,此默认设置可以被 `title``desc``img` 覆盖 | Enum {'403', '404', '500'} | - | | type | 页面类型,若配置,则自带对应类型默认的 `title``desc``img`,此默认设置可以被 `title``desc``img` 覆盖 | Enum {'403', '404', '500'} | - |
| title | 标题 | ReactNode| -| | title | 标题 | ReactNode | - |
| desc| 补充描述| ReactNode| -| | desc | 补充描述 | ReactNode | - |
| img | 背景图片地址 | string| -| | img | 背景图片地址 | string | - |
| actions | 建议操作,配置此属性时默认的『返回首页』按钮不生效| ReactNode| -| | actions | 建议操作,配置此属性时默认的『返回首页』按钮不生效 | ReactNode | - |
| linkElement | 定义链接的元素 | string\|ReactElement | 'a' | | linkElement | 定义链接的元素 | string\|ReactElement | 'a' |
| redirect | 返回按钮的跳转地址 | string | '/' | redirect | 返回按钮的跳转地址 | string | '/' |
...@@ -14,7 +14,7 @@ iframe: 400 ...@@ -14,7 +14,7 @@ iframe: 400
Fixed to the footer. Fixed to the footer.
````jsx ```jsx
import FooterToolbar from 'ant-design-pro/lib/FooterToolbar'; import FooterToolbar from 'ant-design-pro/lib/FooterToolbar';
import { Button } from 'antd'; import { Button } from 'antd';
...@@ -39,6 +39,7 @@ ReactDOM.render( ...@@ -39,6 +39,7 @@ ReactDOM.render(
<Button>Cancel</Button> <Button>Cancel</Button>
<Button type="primary">Submit</Button> <Button type="primary">Submit</Button>
</FooterToolbar> </FooterToolbar>
</div> </div>,
, mountNode); mountNode
```` );
\ No newline at end of file ```
...@@ -12,7 +12,7 @@ It is fixed at the bottom of the content area and does not move along with the s ...@@ -12,7 +12,7 @@ It is fixed at the bottom of the content area and does not move along with the s
## API ## API
Property | Description | Type | Default | Property | Description | Type | Default |
---------|-------------|------|-------- | -------- | ------------------------------------ | --------- | ------- |
children | toolbar content, align to the right | ReactNode | - | children | toolbar content, align to the right | ReactNode | - |
extra | extra information, align to the left | ReactNode | - | extra | extra information, align to the left | ReactNode | - |
\ No newline at end of file
...@@ -13,7 +13,7 @@ order: 6 ...@@ -13,7 +13,7 @@ order: 6
## API ## API
参数 | 说明 | 类型 | 默认值 | 参数 | 说明 | 类型 | 默认值 |
----|------|-----|------ | -------- | -------------------- | --------- | ------ |
children | 工具栏内容,向右对齐 | ReactNode | - | children | 工具栏内容,向右对齐 | ReactNode | - |
extra | 额外信息,向左对齐 | ReactNode | - | extra | 额外信息,向左对齐 | ReactNode | - |
...@@ -6,32 +6,41 @@ iframe: 400 ...@@ -6,32 +6,41 @@ iframe: 400
基本页脚。 基本页脚。
````jsx ```jsx
import GlobalFooter from 'ant-design-pro/lib/GlobalFooter'; import GlobalFooter from 'ant-design-pro/lib/GlobalFooter';
import { Icon } from 'antd'; import { Icon } from 'antd';
const links = [{ const links = [
{
key: '帮助', key: '帮助',
title: '帮助', title: '帮助',
href: '', href: '',
}, { },
{
key: 'github', key: 'github',
title: <Icon type="github" />, title: <Icon type="github" />,
href: 'https://github.com/ant-design/ant-design-pro', href: 'https://github.com/ant-design/ant-design-pro',
blankTarget: true, blankTarget: true,
}, { },
{
key: '条款', key: '条款',
title: '条款', title: '条款',
href: '', href: '',
blankTarget: true, blankTarget: true,
}]; },
];
const copyright = <div>Copyright <Icon type="copyright" /> 2017 蚂蚁金服体验技术部出品</div>; const copyright = (
<div>
Copyright <Icon type="copyright" /> 2017 蚂蚁金服体验技术部出品
</div>
);
ReactDOM.render( ReactDOM.render(
<div style={{ background: '#f5f5f5', overflow: 'hidden' }}> <div style={{ background: '#f5f5f5', overflow: 'hidden' }}>
<div style={{ height: 280 }} /> <div style={{ height: 280 }} />
<GlobalFooter links={links} copyright={copyright} /> <GlobalFooter links={links} copyright={copyright} />
</div> </div>,
, mountNode); mountNode
```` );
```
...@@ -9,7 +9,7 @@ order: 7 ...@@ -9,7 +9,7 @@ order: 7
## API ## API
参数 | 说明 | 类型 | 默认值 | 参数 | 说明 | 类型 | 默认值 |
----|------|-----|------ | --------- | -------- | ---------------------------------------------------------------- | ------ |
links | 链接数据 | array<{ title: ReactNode, href: string, blankTarget?: boolean }> | - | links | 链接数据 | array<{ title: ReactNode, href: string, blankTarget?: boolean }> | - |
copyright | 版权信息 | ReactNode | - | copyright | 版权信息 | ReactNode | - |
...@@ -5,7 +5,7 @@ title: 全局搜索 ...@@ -5,7 +5,7 @@ title: 全局搜索
通常放置在导航工具条右侧。(点击搜索图标预览效果) 通常放置在导航工具条右侧。(点击搜索图标预览效果)
````jsx ```jsx
import HeaderSearch from 'ant-design-pro/lib/HeaderSearch'; import HeaderSearch from 'ant-design-pro/lib/HeaderSearch';
ReactDOM.render( ReactDOM.render(
...@@ -22,13 +22,14 @@ ReactDOM.render( ...@@ -22,13 +22,14 @@ ReactDOM.render(
<HeaderSearch <HeaderSearch
placeholder="站内搜索" placeholder="站内搜索"
dataSource={['搜索提示一', '搜索提示二', '搜索提示三']} dataSource={['搜索提示一', '搜索提示二', '搜索提示三']}
onSearch={(value) => { onSearch={value => {
console.log('input', value); // eslint-disable-line console.log('input', value); // eslint-disable-line
}} }}
onPressEnter={(value) => { onPressEnter={value => {
console.log('enter', value); // eslint-disable-line console.log('enter', value); // eslint-disable-line
}} }}
/> />
</div> </div>,
, mountNode); mountNode
```` );
```
...@@ -9,14 +9,14 @@ Usually placed as an entry to the global search, placed on the right side of the ...@@ -9,14 +9,14 @@ Usually placed as an entry to the global search, placed on the right side of the
## API ## API
参数 | 说明 | 类型 | 默认值 | 参数 | 说明 | 类型 | 默认值 |
----|------|-----|------ | --- | --- | --- | --- |
placeholder | placeholder text | string | - | placeholder | placeholder text | string | - |
dataSource | current list of prompts | string[] | - | dataSource | current list of prompts | string[] | - |
onSearch | Called when searching items. | function(value) | - | onSearch | Called when searching items. | function(value) | - |
onChange | Called when select an option or input value change, or value of input is changed | function(value) | - | onChange | Called when select an option or input value change, or value of input is changed | function(value) | - |
onSelect | Called when a option is selected. param is option's value and option instance. | function(value) | - | onSelect | Called when a option is selected. param is option's value and option instance. | function(value) | - |
onPressEnter | Callback when pressing Enter | function(value) | - | onPressEnter | Callback when pressing Enter | function(value) | - |
onVisibleChange | Show or hide the callback of the text box | function(value) |- | onVisibleChange | Show or hide the callback of the text box | function(value) | - |
defaultOpen | The input box is displayed for the first time. | boolean | false | defaultOpen | The input box is displayed for the first time. | boolean | false |
open | The input box is displayed | boolean |false | open | The input box is displayed | boolean | false |
\ No newline at end of file
...@@ -9,14 +9,14 @@ order: 8 ...@@ -9,14 +9,14 @@ order: 8
## API ## API
参数 | 说明 | 类型 | 默认值 | 参数 | 说明 | 类型 | 默认值 |
----|------|-----|------ | --------------- | ------------------------------------------------- | --------------- | ------ |
placeholder | 占位文字 | string | - | placeholder | 占位文字 | string | - |
dataSource | 当前提示内容列表 | string[] | - | dataSource | 当前提示内容列表 | string[] | - |
onSearch | 搜索补全项的时候调用 | function(value) | - | onSearch | 搜索补全项的时候调用 | function(value) | - |
onChange | 选中 option,或 input 的 value 变化时,调用此函数 | function(value) | - | onChange | 选中 option,或 input 的 value 变化时,调用此函数 | function(value) | - |
onSelect | 被选中时调用,参数为选中项的 value 值 | function(value) | - | onSelect | 被选中时调用,参数为选中项的 value 值 | function(value) | - |
onPressEnter | 按下回车时的回调 | function(value) | - | onPressEnter | 按下回车时的回调 | function(value) | - |
onVisibleChange | 显示或隐藏文本框的回调 | function(value) |- | onVisibleChange | 显示或隐藏文本框的回调 | function(value) | - |
defaultOpen | 输入框首次显示是否显示 | boolean | false | defaultOpen | 输入框首次显示是否显示 | boolean | false |
open | 控制输入框是否显示 | boolean |false | open | 控制输入框是否显示 | boolean | false |
\ No newline at end of file
...@@ -7,7 +7,7 @@ title: ...@@ -7,7 +7,7 @@ title:
Support login with account and mobile number. Support login with account and mobile number.
````jsx ```jsx
import Login from 'ant-design-pro/lib/Login'; import Login from 'ant-design-pro/lib/Login';
import { Alert, Checkbox } from 'antd'; import { Alert, Checkbox } from 'antd';
...@@ -30,27 +30,23 @@ class LoginDemo extends React.Component { ...@@ -30,27 +30,23 @@ class LoginDemo extends React.Component {
notice: '', notice: '',
}, },
() => { () => {
if ( if (!err && (values.username !== 'admin' || values.password !== '888888')) {
!err &&
(values.username !== 'admin' || values.password !== '888888')
) {
setTimeout(() => { setTimeout(() => {
this.setState({ this.setState({
notice: notice: 'The combination of username and password is incorrect!',
'The combination of username and password is incorrect!',
}); });
}, 500); }, 500);
} }
}, }
); );
} }
}; };
onTabChange = (key) => { onTabChange = key => {
this.setState({ this.setState({
type: key, type: key,
}); });
}; };
changeAutoLogin = (e) => { changeAutoLogin = e => {
this.setState({ this.setState({
autoLogin: e.target.checked, autoLogin: e.target.checked,
}); });
...@@ -78,16 +74,10 @@ class LoginDemo extends React.Component { ...@@ -78,16 +74,10 @@ class LoginDemo extends React.Component {
</Tab> </Tab>
<Tab key="tab2" tab="Mobile"> <Tab key="tab2" tab="Mobile">
<Mobile name="mobile" /> <Mobile name="mobile" />
<Captcha <Captcha onGetCaptcha={() => console.log('Get captcha!')} name="captcha" />
onGetCaptcha={() => console.log('Get captcha!')}
name="captcha"
/>
</Tab> </Tab>
<div> <div>
<Checkbox <Checkbox checked={this.state.autoLogin} onChange={this.changeAutoLogin}>
checked={this.state.autoLogin}
onChange={this.changeAutoLogin}
>
Keep me logged in Keep me logged in
</Checkbox> </Checkbox>
<a style={{ float: 'right' }} href=""> <a style={{ float: 'right' }} href="">
...@@ -111,7 +101,7 @@ class LoginDemo extends React.Component { ...@@ -111,7 +101,7 @@ class LoginDemo extends React.Component {
} }
ReactDOM.render(<LoginDemo />, mountNode); ReactDOM.render(<LoginDemo />, mountNode);
```` ```
<style> <style>
#scaffold-src-components-Login-demo-basic .login-warp{ #scaffold-src-components-Login-demo-basic .login-warp{
......
...@@ -10,25 +10,25 @@ Support multiple common ways of login with built-in controls. You can choose you ...@@ -10,25 +10,25 @@ Support multiple common ways of login with built-in controls. You can choose you
### Login ### Login
Property | Description | Type | Default | Property | Description | Type | Default |
----|------|-----|------ | ---------------- | ------------------------------------- | --------------------- | ------- |
defaultActiveKey | default key to activate the tab panel | String | - | defaultActiveKey | default key to activate the tab panel | String | - |
onTabChange | callback on changing tabs | (key) => void | - | onTabChange | callback on changing tabs | (key) => void | - |
onSubmit | callback on submit | (err, values) => void | - | onSubmit | callback on submit | (err, values) => void | - |
### Login.Tab ### Login.Tab
Property | Description | Type | Default | Property | Description | Type | Default |
----|------|-----|------ | -------- | ------------------------- | --------- | ------- |
key | key of the tab | String | - | key | key of the tab | String | - |
tab | displayed text of the tab | ReactNode | - | tab | displayed text of the tab | ReactNode | - |
### Login.UserName ### Login.UserName
Property | Description | Type | Default | Property | Description | Type | Default |
----|------|-----|------ | --- | --- | --- | --- |
name | name of the control, also the key of the submitted data | String | - | name | name of the control, also the key of the submitted data | String | - |
rules | validation rules, same with [option.rules](getFieldDecorator(id, options)) in Form getFieldDecorator(id, options) | object[] | - | rules | validation rules, same with [option.rules](getFieldDecorator(id, options)) in Form getFieldDecorator(id, options) | object[] | - |
Apart from the above properties, Login.Username also support all properties of antd.Input, together with the default values of basic settings, such as _placeholder_, _size_ and _prefix_. All of these default values can be over-written. Apart from the above properties, Login.Username also support all properties of antd.Input, together with the default values of basic settings, such as _placeholder_, _size_ and _prefix_. All of these default values can be over-written.
...@@ -36,11 +36,11 @@ Apart from the above properties, Login.Username also support all properties of a ...@@ -36,11 +36,11 @@ Apart from the above properties, Login.Username also support all properties of a
### Login.Captcha ### Login.Captcha
Property | Description | Type | Default | Property | Description | Type | Default |
----|------|-----|------ | --- | --- | --- | --- |
onGetCaptcha | callback on getting a new Captcha | () => (void \| false \| Promise) | - | onGetCaptcha | callback on getting a new Captcha | () => (void \| false \| Promise) | - |
countDown | count down | number |- | countDown | count down | number | - |
buttonText | text on getting a new Captcha | ReactNode | '获取验证码' | buttonText | text on getting a new Captcha | ReactNode | '获取验证码' |
Apart from the above properties, _Login.Captcha_ support the same properties with _Login.UserName_. Apart from the above properties, _Login.Captcha_ support the same properties with _Login.UserName_.
......
...@@ -11,36 +11,37 @@ order: 15 ...@@ -11,36 +11,37 @@ order: 15
### Login ### Login
参数 | 说明 | 类型 | 默认值 | 参数 | 说明 | 类型 | 默认值 |
----|------|-----|------ | ---------------- | ----------------------- | --------------------- | ------ |
defaultActiveKey | 默认激活 tab 面板的 key | String | - | defaultActiveKey | 默认激活 tab 面板的 key | String | - |
onTabChange | 切换页签时的回调 | (key) => void | - | onTabChange | 切换页签时的回调 | (key) => void | - |
onSubmit | 点击提交时的回调 | (err, values) => void | - | onSubmit | 点击提交时的回调 | (err, values) => void | - |
### Login.Tab ### Login.Tab
参数 | 说明 | 类型 | 默认值 | 参数 | 说明 | 类型 | 默认值 |
----|------|-----|------ | ---- | ---------------- | --------- | ------ |
key | 对应选项卡的 key | String | - | key | 对应选项卡的 key | String | - |
tab | 选项卡头显示文字 | ReactNode | - | tab | 选项卡头显示文字 | ReactNode | - |
### Login.UserName ### Login.UserName
参数 | 说明 | 类型 | 默认值 | 参数 | 说明 | 类型 | 默认值 |
----|------|-----|------ | --- | --- | --- | --- |
name | 控件标记,提交数据中同样以此为 key | String | - | name | 控件标记,提交数据中同样以此为 key | String | - |
rules | 校验规则,同 Form getFieldDecorator(id, options) 中 [option.rules 的规则](getFieldDecorator(id, options)) | object[] | - | rules | 校验规则,同 Form getFieldDecorator(id, options) 中 [option.rules 的规则](getFieldDecorator(id, options)) | object[] | - |
除上述属性以外,Login.UserName 还支持 antd.Input 的所有属性,并且自带默认的基础配置,包括 `placeholder` `size` `prefix` 等,这些基础配置均可被覆盖。 除上述属性以外,Login.UserName 还支持 antd.Input 的所有属性,并且自带默认的基础配置,包括 `placeholder` `size` `prefix` 等,这些基础配置均可被覆盖。
## Login.Password、Login.Mobile 同 Login.UserName ## Login.Password、Login.Mobile 同 Login.UserName
### Login.Captcha ### Login.Captcha
参数 | 说明 | 类型 | 默认值 | 参数 | 说明 | 类型 | 默认值 |
----|------|-----|------ | ------------ | ------------------------ | -------------------------------- | ------------ |
onGetCaptcha | 点击获取校验码的回调 | () => (void \| false \| Promise) | - | onGetCaptcha | 点击获取校验码的回调 | () => (void \| false \| Promise) | - |
countDown | 倒计时 | number |- | countDown | 倒计时 | number | - |
buttonText | 点击获取校验码的说明文字 | ReactNode | '获取验证码' | buttonText | 点击获取校验码的说明文字 | ReactNode | '获取验证码' |
除上述属性以外,Login.Captcha 支持的属性与 Login.UserName 相同。 除上述属性以外,Login.Captcha 支持的属性与 Login.UserName 相同。
......
...@@ -5,8 +5,8 @@ title: 通知图标 ...@@ -5,8 +5,8 @@ title: 通知图标
通常用在导航工具栏上。 通常用在导航工具栏上。
````jsx ```jsx
import NoticeIcon from 'ant-design-pro/lib/NoticeIcon'; import NoticeIcon from 'ant-design-pro/lib/NoticeIcon';
ReactDOM.render(<NoticeIcon count={5} />, mountNode); ReactDOM.render(<NoticeIcon count={5} />, mountNode);
```` ```
...@@ -9,38 +9,44 @@ title: 带浮层卡片 ...@@ -9,38 +9,44 @@ title: 带浮层卡片
import NoticeIcon from 'ant-design-pro/lib/NoticeIcon'; import NoticeIcon from 'ant-design-pro/lib/NoticeIcon';
import { Tag } from 'antd'; import { Tag } from 'antd';
const data = [{ const data = [
{
id: '000000001', id: '000000001',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
title: '你收到了 14 份新周报', title: '你收到了 14 份新周报',
datetime: '2017-08-09', datetime: '2017-08-09',
type: 'notification', type: 'notification',
}, { },
{
id: '000000002', id: '000000002',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png',
title: '你推荐的 曲妮妮 已通过第三轮面试', title: '你推荐的 曲妮妮 已通过第三轮面试',
datetime: '2017-08-08', datetime: '2017-08-08',
type: 'notification', type: 'notification',
}, { },
{
id: '000000003', id: '000000003',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png',
title: '这种模板可以区分多种通知类型', title: '这种模板可以区分多种通知类型',
datetime: '2017-08-07', datetime: '2017-08-07',
read: true, read: true,
type: 'notification', type: 'notification',
}, { },
{
id: '000000004', id: '000000004',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/GvqBnKhFgObvnSGkDsje.png',
title: '左侧图标用于区分不同的类型', title: '左侧图标用于区分不同的类型',
datetime: '2017-08-07', datetime: '2017-08-07',
type: 'notification', type: 'notification',
}, { },
{
id: '000000005', id: '000000005',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png',
title: '内容不要超过两行字,超出时自动截断', title: '内容不要超过两行字,超出时自动截断',
datetime: '2017-08-07', datetime: '2017-08-07',
type: 'notification', type: 'notification',
}, { },
{
id: '000000006', id: '000000006',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
title: '曲丽丽 评论了你', title: '曲丽丽 评论了你',
...@@ -48,7 +54,8 @@ const data = [{ ...@@ -48,7 +54,8 @@ const data = [{
datetime: '2017-08-07', datetime: '2017-08-07',
type: 'message', type: 'message',
clickClose: true, clickClose: true,
}, { },
{
id: '000000007', id: '000000007',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
title: '朱偏右 回复了你', title: '朱偏右 回复了你',
...@@ -56,7 +63,8 @@ const data = [{ ...@@ -56,7 +63,8 @@ const data = [{
datetime: '2017-08-07', datetime: '2017-08-07',
type: 'message', type: 'message',
clickClose: true, clickClose: true,
}, { },
{
id: '000000008', id: '000000008',
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg', avatar: 'https://gw.alipayobjects.com/zos/rmsportal/fcHMVNCjPOsbUGdEduuv.jpeg',
title: '标题', title: '标题',
...@@ -64,35 +72,40 @@ const data = [{ ...@@ -64,35 +72,40 @@ const data = [{
datetime: '2017-08-07', datetime: '2017-08-07',
type: 'message', type: 'message',
clickClose: true, clickClose: true,
}, { },
{
id: '000000009', id: '000000009',
title: '任务名称', title: '任务名称',
description: '任务需要在 2017-01-12 20:00 前启动', description: '任务需要在 2017-01-12 20:00 前启动',
extra: '未开始', extra: '未开始',
status: 'todo', status: 'todo',
type: 'event', type: 'event',
}, { },
{
id: '000000010', id: '000000010',
title: '第三方紧急代码变更', title: '第三方紧急代码变更',
description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
extra: '马上到期', extra: '马上到期',
status: 'urgent', status: 'urgent',
type: 'event', type: 'event',
}, { },
{
id: '000000011', id: '000000011',
title: '信息安全考试', title: '信息安全考试',
description: '指派竹尔于 2017-01-09 前完成更新并发布', description: '指派竹尔于 2017-01-09 前完成更新并发布',
extra: '已耗时 8 天', extra: '已耗时 8 天',
status: 'doing', status: 'doing',
type: 'event', type: 'event',
}, { },
{
id: '000000012', id: '000000012',
title: 'ABCD 版本发布', title: 'ABCD 版本发布',
description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务', description: '冠霖提交于 2017-01-06,需在 2017-01-07 前完成代码变更任务',
extra: '进行中', extra: '进行中',
status: 'processing', status: 'processing',
type: 'event', type: 'event',
}]; },
];
function onItemClick(item, tabProps) { function onItemClick(item, tabProps) {
console.log(item, tabProps); console.log(item, tabProps);
......
...@@ -9,39 +9,39 @@ Used in navigation toolbar as a unified notification center for the entire produ ...@@ -9,39 +9,39 @@ Used in navigation toolbar as a unified notification center for the entire produ
## API ## API
Property | Description | Type | Default | Property | Description | Type | Default |
----|------|-----|------ | --- | --- | --- | --- |
count | Total number of messages | number | - | count | Total number of messages | number | - |
bell | Change the bell Icon | ReactNode | `<Icon type='bell' />` | bell | Change the bell Icon | ReactNode | `<Icon type='bell' />` |
loading | Popup card loading status | boolean | `false` | loading | Popup card loading status | boolean | `false` |
onClear | Click to clear button the callback | function(tabName) | - | onClear | Click to clear button the callback | function(tabName) | - |
onItemClick | Click on the list item's callback | function(item, tabProps) | - | onItemClick | Click on the list item's callback | function(item, tabProps) | - |
onPopupVisibleChange | Popup Card Showing or Hiding Callbacks | function(visible) | - | onPopupVisibleChange | Popup Card Showing or Hiding Callbacks | function(visible) | - |
onTabChange | Switching callbacks for tabs | function(tabTitle) | - | onTabChange | Switching callbacks for tabs | function(tabTitle) | - |
onViewMore | Callback of click for view more | function(tabProps, event) | - | onViewMore | Callback of click for view more | function(tabProps, event) | - |
popupVisible | Popup card display state | boolean | - | popupVisible | Popup card display state | boolean | - |
locale | Default message text | Object | `{ emptyText: 'No notifications', clear: 'Clear', viewMore: 'Loading more' }` | locale | Default message text | Object | `{ emptyText: 'No notifications', clear: 'Clear', viewMore: 'Loading more' }` |
clearClose | Close menu after clear | boolean | `false` | clearClose | Close menu after clear | boolean | `false` |
### NoticeIcon.Tab ### NoticeIcon.Tab
Property | Description | Type | Default | Property | Description | Type | Default |
----|------|-----|------ | --- | --- | --- | --- |
count | Unread messages count of this tab | number | list.length | count | Unread messages count of this tab | number | list.length |
emptyText | Message text when list is empty | ReactNode | - | emptyText | Message text when list is empty | ReactNode | - |
emptyImage | Image when list is empty | string | - | emptyImage | Image when list is empty | string | - |
list | List data, format refer to the following table | Array | `[]` | list | List data, format refer to the following table | Array | `[]` |
showClear | Clear button display status | boolean | `true` | showClear | Clear button display status | boolean | `true` |
showViewMore | View more button display status | boolean | `false` | showViewMore | View more button display status | boolean | `false` |
title | header for message Tab, the actual text is `locale[title] || title` | string | - | title | header for message Tab, the actual text is `locale[title] || title` | string | - |
### Tab data ### Tab data
Property | Description | Type | Default | Property | Description | Type | Default |
----|------|-----|------ | --- | --- | --- | --- |
avatar | avatar img url | string \| ReactNode | - | avatar | avatar img url | string \| ReactNode | - |
title | title | ReactNode | - | title | title | ReactNode | - |
description | description info | ReactNode | - | description | description info | ReactNode | - |
datetime | Timestamps | ReactNode | - | datetime | Timestamps | ReactNode | - |
extra | Additional information in the upper right corner of the list item | ReactNode | - | extra | Additional information in the upper right corner of the list item | ReactNode | - |
clickClose | Close menu after clicking list item | boolean | `false` | clickClose | Close menu after clicking list item | boolean | `false` |
...@@ -9,39 +9,39 @@ order: 9 ...@@ -9,39 +9,39 @@ order: 9
## API ## API
参数 | 说明 | 类型 | 默认值 | 参数 | 说明 | 类型 | 默认值 |
----|------|-----|------ | --- | --- | --- | --- |
count | 图标上的消息总数 | number | - | count | 图标上的消息总数 | number | - |
bell | translate this please -> Change the bell Icon | ReactNode | `<Icon type='bell' />` | bell | translate this please -> Change the bell Icon | ReactNode | `<Icon type='bell' />` |
loading | 弹出卡片加载状态 | boolean | `false` | loading | 弹出卡片加载状态 | boolean | `false` |
onClear | 点击清空按钮的回调 | function(tabName) | - | onClear | 点击清空按钮的回调 | function(tabName) | - |
onItemClick | 点击列表项的回调 | function(item, tabProps) | - | onItemClick | 点击列表项的回调 | function(item, tabProps) | - |
onPopupVisibleChange | 弹出卡片显隐的回调 | function(visible) | - | onPopupVisibleChange | 弹出卡片显隐的回调 | function(visible) | - |
onTabChange | 切换页签的回调 | function(tabTitle) | - | onTabChange | 切换页签的回调 | function(tabTitle) | - |
onViewMore | 点击查看更多的回调 | function(tabProps, event) | - | onViewMore | 点击查看更多的回调 | function(tabProps, event) | - |
popupVisible | 控制弹层显隐 | boolean | - | popupVisible | 控制弹层显隐 | boolean | - |
locale | 默认文案 | Object | `{ emptyText: 'No notifications', clear: 'Clear', viewMore: 'Loading more' }` | locale | 默认文案 | Object | `{ emptyText: 'No notifications', clear: 'Clear', viewMore: 'Loading more' }` |
clearClose | 点击清空按钮后关闭通知菜单 | boolean | `false` | clearClose | 点击清空按钮后关闭通知菜单 | boolean | `false` |
### NoticeIcon.Tab ### NoticeIcon.Tab
参数 | 说明 | 类型 | 默认值 | 参数 | 说明 | 类型 | 默认值 |
----|------|-----|------ | --- | --- | --- | --- |
count | 当前 Tab 未读消息数量 | number | list.length | count | 当前 Tab 未读消息数量 | number | list.length |
emptyText | 针对每个 Tab 定制空数据文案 | ReactNode | - | emptyText | 针对每个 Tab 定制空数据文案 | ReactNode | - |
emptyImage | 针对每个 Tab 定制空数据图片 | string | - | emptyImage | 针对每个 Tab 定制空数据图片 | string | - |
list | 列表数据,格式参照下表 | Array | `[]` | list | 列表数据,格式参照下表 | Array | `[]` |
showClear | 是否显示清空按钮 | boolean | `true` | showClear | 是否显示清空按钮 | boolean | `true` |
showViewMore | 是否显示查看更多按钮 | boolean | `false` | showViewMore | 是否显示查看更多按钮 | boolean | `false` |
title | 消息分类的页签标题,实际的文案是 `locale[title] || title` | string | - | title | 消息分类的页签标题,实际的文案是 `locale[title] || title` | string | - |
### Tab data ### Tab data
参数 | 说明 | 类型 | 默认值 | 参数 | 说明 | 类型 | 默认值 |
----|------|-----|------ | ----------- | ------------------------ | ------------------- | ------- |
avatar | 头像图片链接 | string \| ReactNode | - | avatar | 头像图片链接 | string \| ReactNode | - |
title | 标题 | ReactNode | - | title | 标题 | ReactNode | - |
description | 描述信息 | ReactNode | - | description | 描述信息 | ReactNode | - |
datetime | 时间戳 | ReactNode | - | datetime | 时间戳 | ReactNode | - |
extra | 额外信息,在列表项右上角 | ReactNode | - | extra | 额外信息,在列表项右上角 | ReactNode | - |
clickClose | 点击列表项关闭通知菜单 | boolean | `false` | clickClose | 点击列表项关闭通知菜单 | boolean | `false` |
...@@ -13,7 +13,7 @@ title: ...@@ -13,7 +13,7 @@ title:
Used for presenting various numerical data. Used for presenting various numerical data.
````jsx ```jsx
import NumberInfo from 'ant-design-pro/lib/NumberInfo'; import NumberInfo from 'ant-design-pro/lib/NumberInfo';
import numeral from 'numeral'; import numeral from 'numeral';
...@@ -25,6 +25,7 @@ ReactDOM.render( ...@@ -25,6 +25,7 @@ ReactDOM.render(
status="up" status="up"
subTotal={17.1} subTotal={17.1}
/> />
</div> </div>,
, mountNode); mountNode
```` );
```
...@@ -8,12 +8,12 @@ Often used in data cards for highlighting the business data. ...@@ -8,12 +8,12 @@ Often used in data cards for highlighting the business data.
## API ## API
Property | Description | Type | Default | Property | Description | Type | Default |
----|------|-----|------ | --- | --- | --- | --- |
title | title | ReactNode\|string | - | title | title | ReactNode\|string | - |
subTitle | subtitle | ReactNode\|string | - | subTitle | subtitle | ReactNode\|string | - |
total | total amount | ReactNode\|string | - | total | total amount | ReactNode\|string | - |
subTotal | total amount of additional information | ReactNode\|string | - | subTotal | total amount of additional information | ReactNode\|string | - |
status | increase state | 'up \| down' | - | status | increase state | 'up \| down' | - |
theme | state style | string | 'light' | theme | state style | string | 'light' |
gap | set the spacing (pixels) between numbers and descriptions | number | 8 | gap | set the spacing (pixels) between numbers and descriptions | number | 8 |
...@@ -9,12 +9,12 @@ order: 10 ...@@ -9,12 +9,12 @@ order: 10
## API ## API
参数 | 说明 | 类型 | 默认值 | 参数 | 说明 | 类型 | 默认值 |
----|------|-----|------ | -------- | -------------------------------- | ----------------- | ------- |
title | 标题 | ReactNode\|string | - | title | 标题 | ReactNode\|string | - |
subTitle | 子标题 | ReactNode\|string | - | subTitle | 子标题 | ReactNode\|string | - |
total | 总量 | ReactNode\|string | - | total | 总量 | ReactNode\|string | - |
subTotal | 子总量 | ReactNode\|string | - | subTotal | 子总量 | ReactNode\|string | - |
status | 增加状态 | 'up \| down' | - | status | 增加状态 | 'up \| down' | - |
theme | 状态样式 | string | 'light' | theme | 状态样式 | string | 'light' |
gap | 设置数字和描述之间的间距(像素)| number | 8 | gap | 设置数字和描述之间的间距(像素) | number | 8 |
...@@ -5,7 +5,7 @@ title: Classic ...@@ -5,7 +5,7 @@ title: Classic
典型结果页面。 典型结果页面。
````jsx ```jsx
import Result from 'ant-design-pro/lib/Result'; import Result from 'ant-design-pro/lib/Result';
import { Button, Row, Col, Icon, Steps } from 'antd'; import { Button, Row, Col, Icon, Steps } from 'antd';
...@@ -27,7 +27,9 @@ const desc2 = ( ...@@ -27,7 +27,9 @@ const desc2 = (
周毛毛 周毛毛
<Icon type="dingding" style={{ color: '#00A0E9', marginLeft: 8 }} /> <Icon type="dingding" style={{ color: '#00A0E9', marginLeft: 8 }} />
</div> </div>
<div style={{ marginTop: 8, marginBottom: 4 }}><a href="">催一下</a></div> <div style={{ marginTop: 8, marginBottom: 4 }}>
<a href="">催一下</a>
</div>
</div> </div>
); );
...@@ -75,6 +77,7 @@ ReactDOM.render( ...@@ -75,6 +77,7 @@ ReactDOM.render(
extra={extra} extra={extra}
actions={actions} actions={actions}
style={{ width: '100%' }} style={{ width: '100%' }}
/> />,
, mountNode); mountNode
```` );
```
...@@ -5,7 +5,7 @@ title: Failed ...@@ -5,7 +5,7 @@ title: Failed
提交失败。 提交失败。
````jsx ```jsx
import Result from 'ant-design-pro/lib/Result'; import Result from 'ant-design-pro/lib/Result';
import { Button, Icon } from 'antd'; import { Button, Icon } from 'antd';
...@@ -15,12 +15,18 @@ const extra = ( ...@@ -15,12 +15,18 @@ const extra = (
您提交的内容有如下错误: 您提交的内容有如下错误:
</div> </div>
<div style={{ marginBottom: 16 }}> <div style={{ marginBottom: 16 }}>
<Icon style={{ color: '#f5222d', marginRight: 8 }} type="close-circle" />您的账户已被冻结 <Icon style={{ color: '#f5222d', marginRight: 8 }} type="close-circle" />
<a style={{ marginLeft: 16 }}>立即解冻 <Icon type="right" /></a> 您的账户已被冻结
<a style={{ marginLeft: 16 }}>
立即解冻 <Icon type="right" />
</a>
</div> </div>
<div> <div>
<Icon style={{ color: '#f5222d', marginRight: 8 }} type="close-circle" />您的账户还不具备申请资格 <Icon style={{ color: '#f5222d', marginRight: 8 }} type="close-circle" />
<a style={{ marginLeft: 16 }}>立即升级 <Icon type="right" /></a> 您的账户还不具备申请资格
<a style={{ marginLeft: 16 }}>
立即升级 <Icon type="right" />
</a>
</div> </div>
</div> </div>
); );
...@@ -34,6 +40,7 @@ ReactDOM.render( ...@@ -34,6 +40,7 @@ ReactDOM.render(
description="请核对并修改以下信息后,再重新提交。" description="请核对并修改以下信息后,再重新提交。"
extra={extra} extra={extra}
actions={actions} actions={actions}
/> />,
, mountNode); mountNode
```` );
```
...@@ -5,7 +5,7 @@ title: Structure ...@@ -5,7 +5,7 @@ title: Structure
结构包含 `处理结果``补充信息` 以及 `操作建议` 三个部分,其中 `处理结果``提示图标``标题``结果描述` 组成。 结构包含 `处理结果``补充信息` 以及 `操作建议` 三个部分,其中 `处理结果``提示图标``标题``结果描述` 组成。
````jsx ```jsx
import Result from 'ant-design-pro/lib/Result'; import Result from 'ant-design-pro/lib/Result';
ReactDOM.render( ReactDOM.render(
...@@ -15,6 +15,7 @@ ReactDOM.render( ...@@ -15,6 +15,7 @@ ReactDOM.render(
description={<div style={{ background: 'rgba(16, 142, 233, 1)', color: '#fff' }}>结果描述</div>} description={<div style={{ background: 'rgba(16, 142, 233, 1)', color: '#fff' }}>结果描述</div>}
extra="其他补充信息,自带灰底效果" extra="其他补充信息,自带灰底效果"
actions={<div style={{ background: '#3ba0e9', color: '#fff' }}>操作建议,一般放置按钮组</div>} actions={<div style={{ background: '#3ba0e9', color: '#fff' }}>操作建议,一般放置按钮组</div>}
/> />,
, mountNode); mountNode
```` );
```
...@@ -10,7 +10,7 @@ order: 12 ...@@ -10,7 +10,7 @@ order: 12
## API ## API
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | ----------- | ------------------------------------ | ------------------------- | ------ |
| type | 类型,不同类型自带对应的图标 | Enum {'success', 'error'} | - | | type | 类型,不同类型自带对应的图标 | Enum {'success', 'error'} | - |
| title | 标题 | ReactNode | - | | title | 标题 | ReactNode | - |
| description | 结果描述 | ReactNode | - | | description | 结果描述 | ReactNode | - |
......
...@@ -5,7 +5,7 @@ title: 可展开和收起 ...@@ -5,7 +5,7 @@ title: 可展开和收起
使用 `expandable` 属性,让标签组可以收起,避免过高。 使用 `expandable` 属性,让标签组可以收起,避免过高。
````jsx ```jsx
import TagSelect from 'ant-design-pro/lib/TagSelect'; import TagSelect from 'ant-design-pro/lib/TagSelect';
function handleFormSubmit(checkedValue) { function handleFormSubmit(checkedValue) {
...@@ -26,6 +26,7 @@ ReactDOM.render( ...@@ -26,6 +26,7 @@ ReactDOM.render(
<TagSelect.Option value="cat10">类目十</TagSelect.Option> <TagSelect.Option value="cat10">类目十</TagSelect.Option>
<TagSelect.Option value="cat11">类目十一</TagSelect.Option> <TagSelect.Option value="cat11">类目十一</TagSelect.Option>
<TagSelect.Option value="cat12">类目十二</TagSelect.Option> <TagSelect.Option value="cat12">类目十二</TagSelect.Option>
</TagSelect> </TagSelect>,
, mountNode); mountNode
```` );
```
...@@ -5,7 +5,7 @@ title: 基础样例 ...@@ -5,7 +5,7 @@ title: 基础样例
结合 `Tag``TagSelect` 组件,方便的应用于筛选类目的业务场景中。 结合 `Tag``TagSelect` 组件,方便的应用于筛选类目的业务场景中。
````jsx ```jsx
import TagSelect from 'ant-design-pro/lib/TagSelect'; import TagSelect from 'ant-design-pro/lib/TagSelect';
function handleFormSubmit(checkedValue) { function handleFormSubmit(checkedValue) {
...@@ -20,6 +20,7 @@ ReactDOM.render( ...@@ -20,6 +20,7 @@ ReactDOM.render(
<TagSelect.Option value="cat4">类目四</TagSelect.Option> <TagSelect.Option value="cat4">类目四</TagSelect.Option>
<TagSelect.Option value="cat5">类目五</TagSelect.Option> <TagSelect.Option value="cat5">类目五</TagSelect.Option>
<TagSelect.Option value="cat6">类目六</TagSelect.Option> <TagSelect.Option value="cat6">类目六</TagSelect.Option>
</TagSelect> </TagSelect>,
, mountNode); mountNode
```` );
```
...@@ -12,9 +12,9 @@ order: 13 ...@@ -12,9 +12,9 @@ order: 13
### TagSelect ### TagSelect
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | ------------ | ------------------------- | --------------------- | ------ |
| value |选中的项 |string[] \| number[] | | | value | 选中的项 | string[] \| number[] | |
| defaultValue |默认选中的项 |string[] \| number[] | | | defaultValue | 默认选中的项 | string[] \| number[] | |
| onChange | 标签选择的回调函数 | Function(checkedTags) | | | onChange | 标签选择的回调函数 | Function(checkedTags) | |
| expandable | 是否展示 `展开/收起` 按钮 | Boolean | false | | expandable | 是否展示 `展开/收起` 按钮 | Boolean | false |
| hideCheckAll | 隐藏 `全部` 按钮 | Boolean | false | | hideCheckAll | 隐藏 `全部` 按钮 | Boolean | false |
...@@ -22,6 +22,6 @@ order: 13 ...@@ -22,6 +22,6 @@ order: 13
### TagSelectOption ### TagSelectOption
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | -------- | -------------- | ------------------- | ------ |
| value | TagSelect的值 | string\| number | - | | value | TagSelect 的值 | string\| number | - |
| children | tag的内容 | string \| ReactNode | - | | children | tag 的内容 | string \| ReactNode | - |
...@@ -10,8 +10,11 @@ import Trend from 'ant-design-pro/lib/Trend'; ...@@ -10,8 +10,11 @@ import Trend from 'ant-design-pro/lib/Trend';
ReactDOM.render( ReactDOM.render(
<div> <div>
<Trend flag="up" >12%</Trend> <Trend flag="up">12%</Trend>
<Trend flag="down" style={{ marginLeft: 8 }}>11%</Trend> <Trend flag="down" style={{ marginLeft: 8 }}>
</div> 11%
, mountNode); </Trend>
</div>,
mountNode
);
``` ```
...@@ -10,8 +10,13 @@ import Trend from 'ant-design-pro/lib/Trend'; ...@@ -10,8 +10,13 @@ import Trend from 'ant-design-pro/lib/Trend';
ReactDOM.render( ReactDOM.render(
<div> <div>
<Trend flag="up" reverseColor={true} >12%</Trend> <Trend flag="up" reverseColor={true}>
<Trend flag="down" reverseColor={true} style={{ marginLeft: 8 }}>11%</Trend> 12%
</div> </Trend>
, mountNode); <Trend flag="down" reverseColor={true} style={{ marginLeft: 8 }}>
11%
</Trend>
</div>,
mountNode
);
``` ```
...@@ -14,7 +14,7 @@ order: 14 ...@@ -14,7 +14,7 @@ order: 14
``` ```
| 参数 | 说明 | 类型 | 默认值 | | 参数 | 说明 | 类型 | 默认值 |
|----------|------------------------------------------|-------------|-------| | ------------ | ----------------------- | ------- | ------ |
| colorful | 是否彩色标记 | Boolean | true | | colorful | 是否彩色标记 | Boolean | true |
| flag | 上升下降标识:`up|down` | string | - | | flag | 上升下降标识:`up|down` | string | - |
| reverseColor | 颜色反转 | Boolean | false | | reverseColor | 颜色反转 | Boolean | false |
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment