Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-blocks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
pro-blocks
Commits
fe05a06e
Commit
fe05a06e
authored
Mar 30, 2018
by
低位
Committed by
陈帅
Apr 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
顶部搜索框组件添加默认打开配置 (#1179)
* 顶部搜索框组件添加输入框的常开和首次打开配置 * 顶部搜索框组件移除常开配置,重命名默认打开配置
parent
36feb4cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
src/components/HeaderSearch/index.js
src/components/HeaderSearch/index.js
+4
-1
src/components/HeaderSearch/index.md
src/components/HeaderSearch/index.md
+1
-0
No files found.
src/components/HeaderSearch/index.js
View file @
fe05a06e
...
...
@@ -12,6 +12,7 @@ export default class HeaderSearch extends PureComponent {
className
:
''
,
placeholder
:
''
,
dataSource
:
[],
defaultOpen
:
false
,
};
static
propTypes
=
{
className
:
PropTypes
.
string
,
...
...
@@ -20,9 +21,10 @@ export default class HeaderSearch extends PureComponent {
onPressEnter
:
PropTypes
.
func
,
defaultActiveFirstOption
:
PropTypes
.
bool
,
dataSource
:
PropTypes
.
array
,
defaultOpen
:
PropTypes
.
bool
,
};
state
=
{
searchMode
:
false
,
searchMode
:
this
.
props
.
defaultOpen
,
value
:
''
,
};
componentWillUnmount
()
{
...
...
@@ -56,6 +58,7 @@ export default class HeaderSearch extends PureComponent {
};
render
()
{
const
{
className
,
placeholder
,
...
restProps
}
=
this
.
props
;
delete
restProps
.
defaultOpen
;
// for rc-select not affected
const
inputClass
=
classNames
(
styles
.
input
,
{
[
styles
.
show
]:
this
.
state
.
searchMode
,
});
...
...
src/components/HeaderSearch/index.md
View file @
fe05a06e
...
...
@@ -18,3 +18,4 @@ dataSource | 当前提示内容列表 | string[] | -
onSearch | 选择某项或按下回车时的回调 | function(value) | -
onChange | 输入搜索字符的回调 | function(value) | -
onPressEnter | 按下回车时的回调 | function(value) | -
defaultOpen | 输入框首次显示是否打开 | boolean | false
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