1.0.0 • Published 4 years ago

vue-input-autocomplete v1.0.0

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

Vue Input Autocomplete Component

Installation

# npm
npm install vue-input-autocomplete

Usage

As component

<template>
    <input-auto-complete  className="form-control"
		:value="input"
		id="id"  name="name"
		placeholder="Enter Names Here..."
		:options="options"
		:updateValueHandler="updateValue"></input-auto-complete>
</template>

<script>
    // Import component
    import  InputAutoComplete  from  'vue-input-autocomplete';
    export default {
        components: {
			InputAutoComplete,
		},
		data() {
			return {
				input:  'Default Value',
				options: ['Alex', 'Ben', 'James']
			}
		},
		methods: {
			updateValue(val) {
				this.input = val;
			}
		}
 }
</script>

Available props

The component accepts these props:

AttributeTypeDefaultDescription
valueString''default value of the input component
updateValueHandlerFunction()=>{}updates the parent model value
idStringinputIdid of the input component
nameStringinputNamename of the input component
classNameString''class styling of the input component
placeholderStringEnter here...placeholder of the input component
optionsArray[]dropdown options of the input component

License

MIT License