index.js 745 Bytes
import Taro, {Component} from '@tarojs/taro';
import {View} from '@tarojs/components';
import searchIcon from '../../static/images/search.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>
        )
    }
}