0.0.2 • Published 4 years ago

rdr-autocomplete v0.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

rdr-autocomplete


Autocomplete component for Vue.js

Installation

Using npm

npm i --save rdr-autocomplete

Usage

Bundler (Webpack, Rollup)

import Vue from 'vue'

import RdrAutocomplete from 'rdr-autocomplete'

Vue.use(RdrAutocomplete)

Example

<template>
    <rdr-autocomplete
        :label="'Label'"
        :labelClass="'Label-class'"
        :placeholder="'Placeholder input'"
        :inputClass="classes"
        :items="autocompleteItems"
        v-model="autocompleteValue"
    />
</template>

<script>
export default {
  data () {
    return {
      autocompleteItems: ['Aa', 'Bb', 'Cc', 'Ab', 'Ac']
    }
  },
}
</script>

Properties

NameTypeRequiredDefault valueInfo
inputIdStringNoinput- + 'Random Nr'Chain label to input
labelClassStringNoLabel Class
labelStringNoLabel name
inputClassString or ObjectNoInput Class
placeholderStringNoInput placeholder
inputTypeStringNoSearchInput type (text/search/email/etc..
itemsArrayYesArray which contains the autocomplete items

Events

NameParamsInfo
onChangeitem: Item changedTriggered after any changed in the model
keyEnteritem: Item selectedLike @input, but only when has value
blurtext: Text of search inputTriggered on blur in the search input
focustext: Text of search inputTriggered on focus in the search input

Authors

License

This project is licensed under MIT License