-
Notifications
You must be signed in to change notification settings - Fork 3
/
MyChip.vue
49 lines (48 loc) · 1.02 KB
/
MyChip.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<template>
<div>
<v-combobox
v-model="selectedChips"
:items="availableChips"
label="Best UT Titles"
chips
clearable
prepend-icon="filter_list"
solo
multiple
>
<template slot="selection" slot-scope="data">
<v-chip
:selected="data.selected"
close
@input="remove(data.item)"
>
{{ data.item }}
</v-chip>
</template>
</v-combobox>
</div>
</template>
<script>
export default {
data: () => ({
selectedChips: [
'Unreal',
'Untreal Tournament 2004',
],
availableChips: [
'Unreal',
'Unreal II',
'Unreal Tournament',
'Unreal Tournament 2003',
'Unreal Tournament 3',
'Untreal Tournament 2004',
],
}),
methods: {
remove (item) {
this.selectedChips.splice(this.selectedChips.indexOf(item), 1);
this.selectedChips = [...this.selectedChips];
},
},
};
</script>