index.js
753 Bytes
import Taro, {Component} from '@tarojs/taro';
import {View} from '@tarojs/components';
import searchIcon from '../../static/images/gray_search@3x.png';
import './index.scss';
export default class SearchBar extends Component {
constructor(props) {
super(props);
this.state = {};
}
static defaultProps = {
classname: ''
}
render() {
let {classname, value} = this.props;
return (
<View className={classname + ' search'}>
<Image src={searchIcon} className="search-icon"/>
<Input type='text' placeholder='Search' value={value ? value : ''} onInput={this.props.onInputAction} onConfirm={this.props.onComplate}/>
</View>
)
}
}