From bb1b7e9d4b682163b43b2995b14804eae8b1c643 Mon Sep 17 00:00:00 2001 From: zuiidea Date: Sat, 7 Jan 2017 21:30:48 +0800 Subject: [PATCH] search --- src/components/ui/search.js | 38 +++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/components/ui/search.js b/src/components/ui/search.js index a81de99..38ea62e 100644 --- a/src/components/ui/search.js +++ b/src/components/ui/search.js @@ -2,27 +2,33 @@ import React from 'react' import styles from './search.less' import { Input, Select, Button, Icon } from 'antd' -const Search = (props) => { - const handleSearch = () => { +class Search extends React.Component { + state = { + clearVisible: false + } + handleSearch = () => { // console.log(this.refs.searchInput) } - const handleInputChange = () => { + handleInputChange = (e) => { + console.log(e.target.value) + } + handleClearInput = () => { } - const handleClearInput = () => { - + render () { + const {size, select, selectOptions, selectProps, onSearch} = this.props + const {clearVisible} = this.state + return ( + + {select && } + + + {clearVisible && } + + ) } - const {size, select, selectOptions, selectProps, onSearch} = props - return ( - - {select ? : ''} - - - - - ) } export default Search