I have a pretty simple search text field using vuetify's v-text-field and i want to use show the input that the user has typed in a chip (possibly v-chip or v-combo-box) like this
i think v-text-field doesn't support chip as props based on the document. is there a way to do it? I tried using v-combo-box which is commented out in the code snippet i shared. V-combo-box works when i click on enter and i can take the value from v-model. However, whenever i click on the icon with v-combo-box it doesn't put a chip and also isn't able to get the search value from v-model. Here's my code
<template>
<div>
<!-- <v-combobox v-model="search" chips clearable @keyup.enter="onEnter">
<v-icon small @click.stop="submit"> fas fa-search </v-icon>
</v-combobox> -->
<v-text-field chip v-model="search" label="Search" hint="Company and Campaign Name" clearable autofocus append="hey" @keyup.enter="onEnter">
<v-icon slot="append" small @click="submit"> fas fa-search </v-icon>
</v-text-field>
</div>
</template>
<script>
import Vue from 'vue'
export default Vue.extend({
name: 'MultiSearch',
data() {
return {
search: '',
}
},
methods: {
submit(event) {
event.preventDefault()
console.log('this search', this.search, event)
this.$emit('updateSearch', this.search)
},
onEnter(event) {
console.log('this search', this.search)
this.$emit('updateSearch', this.search)
},
},
})
</script>
<style lang="stylus" scoped>
.v-text-field >>> .v-label
color:black !important
caret-color: black !important
.v-text-field >>> .v-input__control
color:black !important
caret-color:black !important
@media only screen and (min-width:320px) and (max-width:480px){
.v-text-field{
width:200px;
}
}
.v-text-field{
}
</style>
