1.0.4 • Published 3 years ago

vue3-autocomplete v1.0.4

Weekly downloads
44
License
-
Repository
github
Last release
3 years ago

vue3-autocomplete

Table of contents

Installation

Using npm

npm install vue3-autocomplete

Using yarn

yarn add vue3-autocomplete

Usage

Load the component globally...

import App from './App.vue' // Or whatever you need
import Autocomplete from 'vue3-autocomplete'
// Optional: Import default CSS
import 'vue3-autocomplete/dist/vue3-autocomplete.css'

let app = createApp(App)
app.component('Autocomplete', Autocomplete)
app.mount('#app')

... Or locally into your component.

import Autocomplete from 'vue3-autocomplete'
// Optional: Import default CSS
import 'vue3-autocomplete/dist/vue3-autocomplete.css'

export default {
    name: 'YourComponentName',
    components: {
        Autocomplete
    }
}

Use the component into your template.

<template>
    <div>
        <Autocomplete
            @input="getItems"
            :results="items"
        ></Autocomplete>
    </div>
</template>

Properties

PropertyTypeDescriptionRequiredDefault
resultsArrayItems to display in the results listNo[]
display-itemFunctionDescribes how to render each item in resultsNoreturn item.name
debounceIntegerTime to wait before each call to the @input eventNo0
maxIntegerDefine a render limit for results itemsNo10
placeholderStringDefault input placeholderNo''
use-html-for-resultsBooleanIf true, displayItem method will display results as htmlNofalse
input-classArrayOverride input default classesNo[]
results-container-classArrayOverride results container default classesNo[]
results-item-classArrayOverride results item default classesNo[]

Events

EventDescription
@inputTriggered on user input, should update the local results list
@onSelectTriggered when user click on a list item and return the selected item

License

MIT

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

4 years ago

0.9.22

4 years ago

0.9.21

4 years ago

0.9.2

4 years ago

0.9.0

4 years ago

0.9.1

4 years ago

0.1.0

4 years ago