Search
Install

Install


API

Props

nametypedefaultdescriptionrequired version
placeholderstring搜索(search)placeholder text--
cancel-textstring取消(cancel)cancel text--
valuestringinput value, use v-model for binding--
resultsarraysearch results, [{title: 'hello', otherData: otherValue}], will not show when auto-fixed is false--
auto-fixedbooleantrueif auto fixed on top when input gets focus--
topstring0pxtop value when fixed on top--
positionstringfixedposition value when pin the component on the top, one of fixed, absolute--
auto-scroll-to-topbooleanfalseif auto scroll to top when input gets focus--

Events

nameparamsdescriptionrequired 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 focusv2.1.1-rc.10
@on-blur--fires when input losts focusv2.6.3
@on-clear--fires when clicking clear iconv2.9.0

Slots

namedescriptionrequired version
defaultslot above search result--
rightslot on the right of input--
leftslot on the left of inputv2.3.5

Functions

nameparamsdescriptionrequired version
setFocusset focus on input. you should call this method in a click event's callback function on Safari
setBlurmake input lost focusv2.3.6
Variables

Variables

namedefaultdescriptioninherited 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