Socket
Book a DemoInstallSign in
Socket

vue-autocompleter

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-autocompleter

yet another autocomplete plugin

0.3.17
latest
npmnpm
Version published
Weekly downloads
3
200%
Maintainers
2
Weekly downloads
 
Created
Source

vue-autocompleter

yet another autocomplete plugin

Installing

# using yarn
yarn add vue-autocompleter
# using npm
npm install --save vue-autocompleter
# in main.js for example
// ...
import Autocomplete 'vue-autocompleter'

Usage

<Autocomplete
  :placeholder=<placeholder>
  :limit=<limit>
  :transform=<path>
  :api=<api>
  :param=<param>
  :method=<method>
  :closeOnSelect=<closeOnSelect>
  :resetOnSelect=<resetOnSelect>
  :optionsStyles=<optionsStyles>
  :optionStyles=<optionStyles>
  :inputStyles=<inputStyles>
  :optionsClass=<optionsClass>
  :optionClass=<optionClass>
  :inputClass=<inputClass>
  v-model=<msg>
  >
</Autocomplete>

Documentation

PropTypeDescriptionDefault value
placeholderStringinput PlaceholderPlaceholder
limitNumberresults limit5
transform[Function, String]transformer function to map response to the desired option, or just a string representing key to grap from responsenull
apiStringapi endpointnull
paramStringparam for search valueq (demo)
otherParamsObjectother params passed with the request{}
methodStringApi http methodGET
closeOnSelectBooleanClose dropdown once select an elementtrue
resetOnSelectBooleanReset dropdown once select an elementtrue
inputStylesObjectinline styles for input{}
optionsStylesObjectinline styles for options{}
optionStylesObjectinline styles for option item{}
inputClassStringinput classnull
optionsClassStringinput classnull
optionClassStringinput classnull
beforeSearchFunctionfunctions gets called before sending api request, accepts two params (url, query)null
filterMethodFunctionmethod to be used to filter provided options (should return boolean)null
afterSearchFunctionfunctions called after api response, accepts one param (response)null
beforeUpdateValueFunctionfunctions called before update value, accepts one param (value)null
shouldUpdateValueFunctionfunctions called before update value, accepts one param (value) and returns boolean wether to update value or notnull
afterUpdateValueFunctionfunctions called after update value, accepts one param (value)null

Customize option

You can customize how the option will be displayed by adding your template

<!-- example -->
  <template  scope="{option, index}">
    <div class="option">
      <strong>{{index}}</strong>
      <span>{{option}}</span>
    </div>
  </template>

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# run unit tests
npm run unit

# run e2e tests
npm run e2e

# run all tests
npm test

FAQs

Package last updated on 13 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.