1.0.1 • Published 5 years ago

svelte3-autocomplete v1.0.1

Weekly downloads
5
License
ISC
Repository
github
Last release
5 years ago

svelte3-autocomplete

This is a svelte3 library to create autocomplete text fields with both static and async support

To try this library, please run below commands in sequence.

npm install
npm run build:dev

Above commands build the app, to run the app, please install http-server from npm.

   http-server dev/public/.

Then open the app at localhost:8080

Usage

Install the dependencies...

<AutoComplete className="input" name="fruits" items="{names}" />
<AutoComplete
  className="input"
  items="{names}"
  {isAsync}
  bind:this="{autoComplete}"
  on:input="{loadApiData}"
/>

In async case, you need to call this method to send data to the component.

autoComplete.update(data.map(d => d.name));