Gathering detailed insights and metrics for vue-suggestion
Gathering detailed insights and metrics for vue-suggestion
Gathering detailed insights and metrics for vue-suggestion
Gathering detailed insights and metrics for vue-suggestion
npm install vue-suggestion
Typescript
Module System
Node Version
NPM Version
JavaScript (51.96%)
Vue (48.04%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
65 Stars
91 Commits
16 Forks
2 Watchers
12 Branches
4 Contributors
Updated on Mar 25, 2025
Latest Version
2.1.0
Package Id
vue-suggestion@2.1.0
Unpacked Size
0.96 MB
Size
223.57 kB
File Count
19
NPM Version
8.15.0
Node Version
18.7.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
18
Suggestion list input for Vue
Install the plugin:
npm install vue-suggestion
Add the plugin into your app:
1import Vue from 'vue'; 2import VueSuggestion from 'vue-suggestion'; 3 4Vue.use(VueSuggestion);
Use the vue-suggestion
component:
1<template> 2 <vue-suggestion 3 :items="items" 4 v-model="item" 5 :setLabel="setLabel" 6 :itemTemplate="itemTemplate" 7 @changed="inputChange" 8 @selected="itemSelected" 9 > 10 </vue-suggestion> 11</template> 12 13<script> 14 import itemTemplate from './item-template.vue'; 15 export default { 16 data() { 17 return { 18 item: {}, 19 items: [ 20 { id: 1, name: 'Golden Retriever' }, 21 { id: 2, name: 'Cat' }, 22 { id: 3, name: 'Squirrel' }, 23 ], 24 itemTemplate, 25 }; 26 }, 27 methods: { 28 itemSelected(item) { 29 this.item = item; 30 }, 31 setLabel(item) { 32 return item.name; 33 }, 34 inputChange(text) { 35 // your search method 36 this.items = this.items.filter((item) => item.name.indexOf(text) > -1); 37 // now `items` will be showed in the suggestion list 38 }, 39 }, 40 }; 41</script>
ItemTemplate example:
1<template> 2 <div> 3 <b>#{{ item.id }}</b> 4 <span>{{ item.name }}</span> 5 </div> 6</template> 7 8<script> 9 export default { 10 props: { 11 item: { required: true }, 12 }, 13 }; 14</script>
1 npm install vue-suggestion
Install the plugin into Vue:
1import Vue from 'vue'; 2import VueSuggestion from 'vue-suggestion'; 3 4Vue.use(VueSuggestion, [(globalOptions = {})]); // Define default global options here (optional)
View all available options in Props.
Or use the component directly:
1<!-- your-component.vue--> 2<template> 3 <vue-suggestion v-model="value"></vue-suggestion> 4</template> 5 6<!-- some-sample-css-as-example-for-your-dropdown-autocomplete --> 7<style scope> 8 .vue-suggestion .vs__list { 9 width: 100%; 10 text-align: left; 11 border: none; 12 border-top: none; 13 max-height: 400px; 14 overflow-y: auto; 15 border-bottom: 1px solid #023d7b; 16 position: relative; 17 } 18 .vue-suggestion .vs__list .vs__list-item { 19 background-color: #fff; 20 padding: 10px; 21 border-left: 1px solid #023d7b; 22 border-right: 1px solid #023d7b; 23 } 24 .vue-suggestion .vs__list .vs__list-item:last-child { 25 border-bottom: none; 26 } 27 .vue-suggestion .vs__list .vs__list-item:hover { 28 background-color: #eee !important; 29 } 30 .vue-suggestion .vs__list, 31 .vue-suggestion .vs__loading { 32 position: absolute; 33 } 34 .vue-suggestion .vs__list .vs__list-item { 35 cursor: pointer; 36 } 37 .vue-suggestion .vs__list .vs__list-item.vs__item-active { 38 background-color: #f3f6fa; 39 } 40</style> 41 42<script> 43 import { VueSuggestion } from 'vue-suggestion'; 44 45 export default { 46 components: { 47 VueSuggestion, 48 }, 49 }; 50</script>
Include vue-suggestion in the page.
1<script src="https://unpkg.com/vue-suggestion"></script>
If Vue is detected in the Page, the plugin is installed automatically.
Manually install the plugin into Vue:
1Vue.use(VueSuggestion);
Or use the component directly:
1Vue.component('vue-suggestion', VueSuggestion.VueSuggestion);
Copyright (c) 2018 Steven Dao. Released under the MIT License.
made with ❤ by Steven.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/26 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
65 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More