Skip to content

SearchInput 搜索框

Demo

loading

Types

ts
export interface SearchInputProps {
  value?: string | null
  type?: ButtonProps['type']
  placeholder?: string
  autoTrigger?: boolean | number
  searchButton?: 'text' | 'icon' | boolean
  inputProps?: InputProps
  buttonProps?: ButtonProps
  loading?: boolean
}

Props

NameTypeDefaultDescription
valueString-文本输入的值
typeString-输入框类型
placeholderString-输入框占位符
autoTriggerBoolean|Numbertrue是否自动触发搜索,如果值为Number,则设置自动触发的延迟时间。
searchButtonBoolean or 'text' or 'icon'true是否显示搜索按钮
loadingBooleanfalse搜索按钮是否加载中
inputPropsInputProps-输入框配置
buttonPropsButtonProps-按钮配置
@update:value(value:string) => void-输入框值 停止输入 时触发

Slots

NameDescription
icon自定义图标内容
button自定义搜索按钮内容