Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ant-design-pro
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thiago Borges
ant-design-pro
Commits
d6386bbb
Commit
d6386bbb
authored
Oct 13, 2017
by
afc163
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update components API and demo
parent
3ab00435
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
117 additions
and
6 deletions
+117
-6
basic.md
src/components/FooterToolbar/demo/basic.md
+29
-0
index.md
src/components/FooterToolbar/index.md
+11
-0
basic.md
src/components/GlobalFooter/demo/basic.md
+2
-1
index.md
src/components/GlobalFooter/index.md
+4
-4
basic.md
src/components/HeaderSearch/demo/basic.md
+35
-0
index.js
src/components/HeaderSearch/index.js
+17
-1
index.md
src/components/HeaderSearch/index.md
+19
-0
No files found.
src/components/FooterToolbar/demo/basic.md
0 → 100644
View file @
d6386bbb
---
order
:
0
title
:
演示
iframe
:
600
---
浮动固定页脚。
```
`jsx
import FooterToolbar from 'ant-design-pro/lib/FooterToolbar';
import { Icon } from 'antd';
ReactDOM.render(
<div style={{ background: '#f7f7f7' }}>
<p>页面内容 页面内容 页面内容 页面内容</p>
<p>页面内容 页面内容 页面内容 页面内容</p>
<p>页面内容 页面内容 页面内容 页面内容</p>
<p>页面内容 页面内容 页面内容 页面内容</p>
<p>页面内容 页面内容 页面内容 页面内容</p>
<p>页面内容 页面内容 页面内容 页面内容</p>
<p>页面内容 页面内容 页面内容 页面内容</p>
<p>页面内容 页面内容 页面内容 页面内容</p>
<FooterToolbar extra="提示信息">
<Button type="primary">提交</Button>
<Button>取消</Button>
</FooterToolbar>
</div>
, mountNode);
```
`
src/components/FooterToolbar/index.md
View file @
d6386bbb
...
@@ -6,4 +6,15 @@ subtitle: 底部固定工具栏
...
@@ -6,4 +6,15 @@ subtitle: 底部固定工具栏
cols
:
1
cols
:
1
---
---
固定在底部的工具栏。
## 何时使用
固定在内容区域的底部,不随滚动条移动,常用于长页面的数据搜集和提交工作。
## API
## API
参数 | 说明 | 类型 | 默认值
----|------|-----|------
children | 工具栏内容,向右对齐 | ReactNode | -
extra | 额外信息,向左对齐 | ReactNode | -
src/components/GlobalFooter/demo/basic.md
View file @
d6386bbb
---
---
order
:
0
order
:
0
title
:
Basic
title
:
演示
iframe
:
600
---
---
基本页脚。
基本页脚。
...
...
src/components/GlobalFooter/index.md
View file @
d6386bbb
...
@@ -10,7 +10,7 @@ cols: 1
...
@@ -10,7 +10,7 @@ cols: 1
## API
## API
| 参数 | 说明 | 类型 | 默认值 |
参数 | 说明 | 类型 | 默认值
|----------|------------------------------------------|-------------|-------|
----|------|-----|------
| links | 链接数据 | array
<
{
title:
ReactNode
,
href:
string
,
blankTarget
?
:
boolean
}
>
| - |
links | 链接数据 | array
<
{
title:
ReactNode
,
href:
string
,
blankTarget
?
:
boolean
}
>
| -
| copyright | 版权信息 | ReactNode | - |
copyright | 版权信息 | ReactNode | -
src/components/HeaderSearch/demo/basic.md
0 → 100644
View file @
d6386bbb
---
order
:
0
title
:
全局搜索
---
通常放在全局导航条右侧。
```
`jsx
import HeaderSearch from 'ant-design-pro/lib/HeaderSearch';
import { Icon } from 'antd';
ReactDOM.render(
<div
style={{
textAlign: 'right',
height: '64px',
lineHeight: '64px',
boxShadow: '0 1px 4px rgba(0,21,41,.12)',
padding: '0 32px',
width: '400px',
}}
>
<HeaderSearch
placeholder="站内搜索"
dataSource={['搜索提示一', '搜索提示二', '搜索提示三']}
onSearch={(value) => {
console.log('input', value); // eslint-disable-line
}}
onPressEnter={(value) => {
console.log('enter', value); // eslint-disable-line
}}
/>
</div>
, mountNode);
```
`
src/components/HeaderSearch/index.js
View file @
d6386bbb
import
React
,
{
PureComponent
}
from
'react'
;
import
React
,
{
PureComponent
}
from
'react'
;
import
PropTypes
from
'prop-types'
;
import
{
Input
,
Icon
,
AutoComplete
}
from
'antd'
;
import
{
Input
,
Icon
,
AutoComplete
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
classNames
from
'classnames'
;
import
styles
from
'./index.less'
;
import
styles
from
'./index.less'
;
...
@@ -6,6 +7,21 @@ import styles from './index.less';
...
@@ -6,6 +7,21 @@ import styles from './index.less';
export
default
class
HeaderSearch
extends
PureComponent
{
export
default
class
HeaderSearch
extends
PureComponent
{
static
defaultProps
=
{
static
defaultProps
=
{
defaultActiveFirstOption
:
false
,
defaultActiveFirstOption
:
false
,
onPressEnter
:
()
=>
{},
onChange
:
()
=>
{},
onSearch
:
()
=>
{},
className
:
''
,
placeholder
:
''
,
dataSource
:
[],
};
static
propTypes
=
{
className
:
PropTypes
.
string
,
placeholder
:
PropTypes
.
string
,
onSearch
:
PropTypes
.
func
,
onPressEnter
:
PropTypes
.
func
,
onChange
:
PropTypes
.
func
,
defaultActiveFirstOption
:
PropTypes
.
bool
,
dataSource
:
PropTypes
.
array
,
};
};
state
=
{
state
=
{
searchMode
:
false
,
searchMode
:
false
,
...
@@ -23,6 +39,7 @@ export default class HeaderSearch extends PureComponent {
...
@@ -23,6 +39,7 @@ export default class HeaderSearch extends PureComponent {
}
}
onChange
=
(
value
)
=>
{
onChange
=
(
value
)
=>
{
this
.
setState
({
value
});
this
.
setState
({
value
});
this
.
props
.
onChange
();
}
}
enterSearchMode
=
()
=>
{
enterSearchMode
=
()
=>
{
this
.
setState
({
searchMode
:
true
},
()
=>
{
this
.
setState
({
searchMode
:
true
},
()
=>
{
...
@@ -49,7 +66,6 @@ export default class HeaderSearch extends PureComponent {
...
@@ -49,7 +66,6 @@ export default class HeaderSearch extends PureComponent {
className
=
{
inputClass
}
className
=
{
inputClass
}
value
=
{
this
.
state
.
value
}
value
=
{
this
.
state
.
value
}
onChange
=
{
this
.
onChange
}
onChange
=
{
this
.
onChange
}
onSelect
=
{
this
.
onSelect
}
{...
restProps
}
{...
restProps
}
>
>
<
Input
<
Input
...
...
src/components/HeaderSearch/index.md
0 → 100644
View file @
d6386bbb
---
category
:
Components
type
:
General
title
:
HeaderSearch
subtitle
:
顶部搜索框
cols
:
1
---
用在顶部导航上,提供应用全局搜索入口。
## API
参数 | 说明 | 类型 | 默认值
----|------|-----|------
placeholder | 占位文字 | string | -
dataSource | 当前提示内容列表 | string
[]
| -
onSearch | 选择某项或按下回车时的回调 | function(value) | -
onChange | 输入搜索字符的回调 | function(value) | -
onPressEnter | 按下回车时的回调 | function(value) | -
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment