API
Variables
Props
name | type | default | description | required version |
placeholder | string | 搜索(search) | placeholder text | -- |
cancel-text | string | 取消(cancel) | cancel text | -- |
value | string | input value, use v-model for binding | -- | |
results | array | search results, [{title: 'hello', otherData: otherValue}], will not show when auto-fixed is false | -- | |
auto-fixed | boolean | true | if auto fixed on top when input gets focus | -- |
top | string | 0px | top value when fixed on top | -- |
position | string | fixed | position value when pin the component on the top, one of fixed , absolute | -- |
auto-scroll-to-top | boolean | false | if auto scroll to top when input gets focus | -- |
Events
name | params | description | required version |
@on-submit | (value) | emits when form is submitted | -- |
@on-cancel | -- | emits when cancel button is clicked | -- |
@on-change | (value) | emits when value is changed | -- |
@on-result-click | (item) | emits when result item is clicked | -- |
@on-focus | -- | when input gets focus | v2.1.1-rc.10 |
@on-blur | -- | fires when input losts focus | v2.6.3 |
@on-clear | -- | fires when clicking clear icon | v2.9.0 |
Slots
name | description | required version |
default | slot above search result | -- |
right | slot on the right of input | -- |
left | slot on the left of input | v2.3.5 |
Functions
name | params | description | required version |
setFocus | set focus on input. you should call this method in a click event's callback function on Safari | ||
setBlur | make input lost focus | v2.3.6 |
Variables
name | default | description | inherited name |
@search-cancel-font-color | #09BB07 | text color of cancel button | |
@search-bg-color | #EFEFF4 | background color | |
@search-placeholder-font-color | #9B9B9B | text color of placeholder |
Contributors
Contributors
Total commits quantity: 43,Total contributors quantity: 4
airylandLinHaobinFisher光君Changelog
Releases
- v2.9.0 [feature] add event:on-clear #2251
- 2.7.6 [fix] fix not emit on-change and input events when cancel or clear
- v2.7.3 [fix] fix event:on-change fires before compositionend
- v2.6.3 [feature] add event:on-blur
- v2.3.6 [feature] Add method:setBlur
- v2.3.5 [feature] Add slot:left
- v2.2.2 [enhance] Show search text on iOS keyboard
- v2.2.0 [enhance] emit on-change after input
- v2.1.1-rc.13 [feature] Add slot:right
- v2.1.1-rc.12 [enhance] do not emit on-change is isCancel = true
- v2.1.1-rc.10 [feature] Add event on-focus