File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 8
8
<span v-for =" itm in value" :key =" name != '' ? itm[name] : itm" class =" badge" >
9
9
{{ name != "" ? itm[name] : itm }}
10
10
</span >
11
+ <button
12
+ v-if =" value.length > 0"
13
+ type =" button"
14
+ class =" absolute inset-y-0 right-6 flex items-center rounded-r-md px-2 focus:outline-none"
15
+ @click =" clear"
16
+ >
17
+ <MdiClose class =" size-5" />
18
+ </button >
11
19
</div >
12
20
<div
13
21
tabindex =" 0"
36
44
</template >
37
45
38
46
<script lang="ts" setup>
47
+ import MdiClose from " ~icons/mdi/close" ;
48
+
39
49
const emit = defineEmits ([" update:modelValue" ]);
40
50
const props = defineProps ({
41
51
label: {
78
88
});
79
89
});
80
90
91
+ function clear() {
92
+ value .value = [];
93
+ }
94
+
81
95
const selected = computed <string []>(() => {
82
96
return value .value .map (itm => itm [props .uniqueField ]);
83
97
});
You can’t perform that action at this time.
0 commit comments