0.1.2 • Published 7 years ago

my-autocompletec v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

AutoComplete

a component to auto complete input

Installation

npm i my-autocompletec -S

Usage

import {AutoComplete} from 'my-autocompletec';

new AutoComplete({
    target: '#input',
    dataset: [],
    debounce: 300
})

Params

ParameterTypeDefaultDescription
targetstringthe input's selector used in document.querySelector
datasetarrayauto complete will pick data from this array, must be a object array width id and value property
debouncenumbermilliseconds to delay the input complete trigger
modestringindexOfother option includes startWidth and endWidth

Methods

Nameparamsreturn valueDescription
changeDatadatasetchange auto complete component's dataset