1.1.1 • Published 2 years ago

vue-autocomplete-ele v1.1.1

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

Table of Contents

Introduction

vue-autocomplete-ele is an Vue component completion suggester.\ vue-autocomplete-ele is a MIT-licensed open source project, it is an autcomplete element for your Vue Project which do not use or depends on any third party library.\ Tested in Firefox, Safari, Chrome, Opera, Internet Explorer 8+. No dependencies, written in plain JavaScript. vue-autocomplete-ele is lightweight and Highly configurable which makes its useful in number of situations.

Features

  • Lightweight.
  • No jQuery, written in vanilla JS.
  • Smart caching, delay and minimum character settings.
  • Callbacks

Installation

npm install vue-autocomplete-ele

Usage

import VueAutocompleteEle from 'vue-autocomplete-ele';

Configuration

PropTypeDefault Description
srcObject{ data: Array, valueIndex: String <from data>, labelIndex: String <from data>}
idStringvue-autocomplete
minCharsNumber0Minimum number of characters (>=1) a user must type before a search is performed.
delayNumber0The delay in milliseconds between when a keystroke occurs and when a search is performed. A zero-delay is more responsive, but can produce a lot of load.
offsetLeftNumber1Optional left offset of the suggestions container.
offsetTopNumber1Optional top offset of the suggestions container.
inputClassStringCustom class/es that get/s added to the input element.
containerClassStringCustom class/es that get/s added to the dropdown menu container.
suggestionClassStringCustom class/es that get/s added to the dropdown menu.
noCacheBooleanfalseDetermines if performed searches should be cached.
sourceHandlerFunctionThe sourceHandler function iterates through an array of (local) choices and we return a new array containing all (lowercased) matches.
renderHandlerFunctionThe renderHandler function allows to customize the dropdown menu item
onSelectHandlerFunctionThe onSelectHandler function allows to do something on select event

Example

<vue-autocomplete-ele
    :src="{
        data: [
            {
                'id': 125,
                'sku': 'AAAAAAAAAA',
            },
            {
                'id': 154,
                'sku': 'LIQ-01',
            },
            {
                'id': 186,
                'sku': 'SHEET-01',
            },
            {
                'id': 187,
                'sku': 'SHEET-02',
            }
        ],
        valueIndex: 'id',
        labelIndex: 'sku'
    }"
    @selected="autocomplete = $event" // returning data for valueIndex for selected item
/>

References

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago