Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

v-autocomplete

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

v-autocomplete

Autocomplete component for Vue.js

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.2K
decreased by-4.55%
Maintainers
1
Weekly downloads
 
Created
Source

v-autocomplete

Autocomplete component for Vue.js

Usage

Installation

Using yarn

yarn add v-autocomplete

Using npm

npm i --save v-autocomplete

Demo

DEMO

Usage

Bundler (Webpack, Rollup)

import Vue from 'vue'

import Autocomplete from 'v-autocomplete'

// You need a specific loader for CSS files like https://github.com/webpack/css-loader
import 'v-autocomplete/dist/v-autocomplete.css'

Vue.use(Autocomplete)

Browser

<!-- Include after Vue -->
<link rel="stylesheet" href="v-autocomplete/dist/v-autocomplete.css"></link>
<script src="v-autocomplete/dist/v-autocomplete.js"></script>
<script>
  Vue.use(Autocomplete)
</script>

Usage example

<!-- in your component -->
<v-autocomplete :items="items" v-model="item" :get-label="getLabel" @updateItems="updateItems">
</v-autocomplete>
// in your component
// ...
data () {
  return {
    item: {label: 'Item 4', id: 4},
    items: []
  }
},
methods: {
  getLabel (item) {
    return item.label
  },
  updateItems (text) {
    yourGetItemsMethod(text).then( (response) => {
      this.items = response
    })
  }
},
// ...

Params

NameTypeRequiredDefault valueInfo
itemsArrayYesList items
componentItemVue Component or Function or StringNoItemTemplate of item list
placeholderStringNo
minLenNumberNo3Min length to input search call 'updateItems' event
waitStringNo500Wait of input change before call 'updateItems' event
getLabelFunctionNofunction(item) { return item }Custom function to extract label of item
valueMixedNoInitial value (use v-model)

License

This project is licensed under MIT License

Keywords

FAQs

Package last updated on 26 Apr 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc