-
Notifications
You must be signed in to change notification settings - Fork 19
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
Showing
10 changed files
with
137 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
export default [ | ||
{ | ||
title: "API", | ||
json: [ | ||
{ | ||
props: "type", | ||
intro: "提示类型", | ||
type: "'success' | 'info' | 'warning' | 'error'", | ||
defaultValue: "-", | ||
}, | ||
{ | ||
props: "closable", | ||
intro: "是否支持关闭", | ||
type: "boolean", | ||
defaultValue: "false", | ||
}, | ||
{ | ||
props: "showIcon", | ||
intro: "是否显示图标", | ||
type: "boolean", | ||
defaultValue: "false", | ||
}, | ||
{ | ||
props: "icon", | ||
intro: "自定义图标", | ||
type: "ReactNode", | ||
defaultValue: "-", | ||
}, | ||
{ | ||
props: "title", | ||
intro: "标题", | ||
type: "ReactNode | string", | ||
defaultValue: "-", | ||
}, | ||
{ | ||
props: "onClose", | ||
intro: "关闭回调", | ||
type: "() => void", | ||
defaultValue: "-", | ||
}, | ||
] | ||
} | ||
] |
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,3 @@ | ||
#### 带图标 | ||
可以通过`icon`设置图标,并且可以自定义`onClose`回调。 | ||
|
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,28 @@ | ||
import * as React from 'react'; | ||
import { Alert, Icon } from '../../../../components/'; | ||
|
||
export default function () { | ||
return ( | ||
<div> | ||
<Alert | ||
type="success" | ||
showIcon | ||
title="成功提示文案" | ||
closable | ||
onClose={() => alert('关闭了')} | ||
> | ||
<span>成功提示文案成功提示文案成功提示文案成功提示文案成功提示文案成功提示文案成功提示文案成功提示文案成功提示文案成功提示文案成功提示文案成功提示文案</span> | ||
</Alert> | ||
<Alert | ||
type="info" | ||
icon={<Icon type="paper-airplane"/>} | ||
showIcon | ||
closable | ||
title="自定义文案" | ||
/> | ||
<Alert type="info" showIcon title="消息提示文案"/> | ||
<Alert type="warning" showIcon title="警告提示文案"/> | ||
<Alert type="error" showIcon title="错误提示文案"/> | ||
</div> | ||
) | ||
} |
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,2 @@ | ||
#### 基本使用 | ||
简单的基本使用,一共四种Ttype,`success`、 `info`、`warning`、`error`。 |
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,13 @@ | ||
import * as React from 'react'; | ||
import { Alert } from '../../../../components/'; | ||
|
||
export default function () { | ||
return ( | ||
<div> | ||
<Alert type="success" title="成功提示文案"/> | ||
<Alert type="info" title="消息提示文案"/> | ||
<Alert type="warning" title="警告提示文案"/> | ||
<Alert type="error" title="错误提示文案"/> | ||
</div> | ||
) | ||
} |
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,4 @@ | ||
## Alert 提示 | ||
用于页面提示用户一些需要关注的信息。 | ||
|
||
## 代码演示 |
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,30 @@ | ||
import * as React from 'react'; | ||
import { Component } from 'react'; | ||
import * as md from './index.md'; | ||
import Markdown from '../../components/Markdown/'; | ||
import CodeBox from '../../components/CodeBox/'; | ||
import ApiBox from '../../components/ApiBox/'; | ||
import Api from './api'; | ||
|
||
import AlertDemo from './demo/alertDemo'; | ||
import * as alertDemoMd from './demo/alertDemo.md'; | ||
const alertDemoCode = require('!raw-loader!./demo/alertDemo'); | ||
|
||
import AlertCustom from './demo/alertCustom'; | ||
import * as alertCustomMd from './demo/alertCustom.md'; | ||
const alertCustomCode = require('!raw-loader!./demo/alertCustom'); | ||
|
||
export default class AlertPage extends Component { | ||
render() { | ||
return ( | ||
<div> | ||
<Markdown text={md}/> | ||
<CodeBox text={alertDemoMd} demo={<AlertDemo/>} code={alertDemoCode}/> | ||
|
||
<CodeBox text={alertCustomMd} demo={<AlertCustom/>} code={alertCustomCode}/> | ||
<ApiBox api={Api}/> | ||
</div> | ||
) | ||
} | ||
}; | ||
|
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