yarn add vue-simple-complete npm i vue-simple-complete
|:items||Array||This contains data for the auto-complete, this can either be an array of string or an array of custom objects|
|:objectMatchkey||String||This is required if the items is of type object array. The objectMatchKey then becomes the key that is used within the match function|
|:template||Object||This is required if the items is of type object array. The template is then used to display the items as per the defined template. If the template is not defined then ObjectMatchKey will be used to form the items display|
|@inputChanged||Function||When input is changed this event gets fired. The consumers of the vue-simple-complete component can listen to this event and get the entered or selected value|
- The component comes with a
basic styling, and the items panel usually takes the full width of the container it's placed in. To contain it's width, it can be wrapped within a
divwith custom width.
Downkeys can be used to go over the items in the list.
Downkey can be used to open the items panel, when the panel is collapsed.
Esckey will clear out the selected value when the focus is on the input
Example-1: With items of Object type
Example-2: With items of string type
There is a known issue where you will see the following error when you import the component into a TypeScript project
Could not find a declaration file for module 'vue-simple-complete'. Try `npm install @types/vue-simple-complete` if it exists or add a new declaration (.d.ts) file containing `declare module 'vue-simple-complete';`
As a temporary solution, please edit your TypeScript Config file (tsconfig.json) and add a new key value pair, as -