I am using Form Tags components bootstrap-vue framework. I want to use vue-simple-suggest component (from npm) with form tags to suggest words related to user's query. User can select multiple words from suggestion, and the selected word will be saved in form tags as a pill as shown in image below.
I don't know how to merge both the components as a single component (or more better way), so that I can use UI feature of bootstrap with auto-suggest feature of a third party module.
I am learning VueJs, I don't know what should I learn to do this?
Here is my code:
<template>
<div>
<vue-simple-suggest
v-model="chosen"
mode="select"
:list="simpleSuggestionsList"
:filter-by-query="true"
:destyled="false"
>
<b-form-tags
placeholder="Enter Keyword"
size="lg"
tag-variant="success"
tag-pills
remove-on-delete
separator=","
class="my-3"
@input="updateValue"
></b-form-tags>
</vue-simple-suggest>
</div>
</template>
<script>
import VueSimpleSuggest from 'vue-simple-suggest'
import 'vue-simple-suggest/dist/styles.css'
export default {
name: "SeedWordsSuggestions",
data() {
return {
chosen: '',
seedWords: []
}
},
components: {
VueSimpleSuggest
},
methods: {
simpleSuggestionsList() {
return [
'Angular',
'ReactJs',
'VueJs'
]
},
addSelectedWord(e) {
console.log(`addSelectedWord`, e)
},
updateValue(value) {
const pos = value.length
this.seedWords.push(value[pos - 1])
console.log(this.seedWords)
}
}
}
</script>
<style scoped>
</style>