v0.0.4
This commit is contained in:
27
src/components/ui/SearchBar/index.tsx
Normal file
27
src/components/ui/SearchBar/index.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import { Input, View } from '@tarojs/components'
|
||||
import Icon from '@/components/ui/Icon'
|
||||
import './index.scss'
|
||||
|
||||
interface SearchBarProps {
|
||||
placeholder: string
|
||||
value?: string
|
||||
onInput?: (value: string) => void
|
||||
}
|
||||
|
||||
export function SearchBar({ placeholder, value = '', onInput }: SearchBarProps) {
|
||||
return (
|
||||
<View className='search-bar'>
|
||||
<Icon name='search' size={14} />
|
||||
<Input
|
||||
className='search-bar__input'
|
||||
value={value}
|
||||
placeholder={placeholder}
|
||||
placeholderClass='search-bar__placeholder'
|
||||
onInput={event => onInput?.(String(event.detail.value))}
|
||||
/>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
export default SearchBar
|
||||
|
||||
Reference in New Issue
Block a user