import { Button, Icon, Search } from 'vant' import { defineComponent, PropType } from 'vue' import styles from './index.module.less' import iconSearch from '@common/images/icon_search.png' import iconFilter from '@common/images/icon_filter.png' type inputBackground = 'default' | 'white' export default defineComponent({ name: 'ColSearch', props: { modelValue: { type: String, default: '' }, showAction: { type: Boolean, default: false }, disabled: { type: Boolean, default: false }, autofocus: { type: Boolean, default: false }, placeholder: { type: String, default: '请输入搜索关键词' }, background: { type: String, default: '#fff' }, inputBackground: { type: String as PropType, default: 'default' }, onSearch: { type: Function, default: (val: string) => {} }, onFilter: { type: Function, default: () => {} }, filterDot: { type: Boolean, default: false } }, watch: { modelValue() { this.search = this.modelValue } }, data() { return { search: this.modelValue || '' } }, render() { return ( { this.onSearch(val) }} v-slots={{ 'left-icon': () => , 'right-icon': () => ( ), action: () => ( { this.onFilter() }} /> ) }} /> ) } })