47 lines
1.0 KiB
JavaScript
47 lines
1.0 KiB
JavaScript
|
|
import Taro, { Component } from '@tarojs/taro'
|
|
import { View, Button, Text } from '@tarojs/components'
|
|
import { AtSearchBar } from 'taro-ui'
|
|
|
|
|
|
import './searchBarComponent.scss'
|
|
|
|
|
|
|
|
class SearchBarComponent extends Component {
|
|
|
|
|
|
config = {
|
|
navigationBarTitleText: 'searchBarComponent'
|
|
}
|
|
constructor() {
|
|
|
|
super(...arguments)
|
|
this.state = {
|
|
value: ''
|
|
}
|
|
}
|
|
onChange(value) {
|
|
this.setState({
|
|
value: value
|
|
})
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<View className='searchBarComponent'>
|
|
<View className='searchBar-box'>
|
|
<AtSearchBar className='search-button'
|
|
actionName='搜索'
|
|
value={this.state.value}
|
|
onChange={this.onChange.bind(this)}
|
|
onActionClick={this.onActionClick.bind(this)}
|
|
/>
|
|
</View>
|
|
</View>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default SearchBarComponent
|