/
item.vue
61 lines (58 loc) · 1.1 KB
/
item.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
50
51
52
53
54
55
56
57
58
59
60
61
<template lang="pug">
div(v-if="emptyItem")
.item-wrapper
.item.item-empty
.item-content
span.item-label(v-if="label") {{ label }}
b-popover(
v-else,
:triggers="['hover']",
:placement="popoverPosition",
@click="click",
)
span(slot="content")
slot(name="popoverContent", :item="item")
.item-wrapper
.item
slot(name="itemBadge", :item="item")
span.item-content(:class="itemContentClass")
span.item-label(v-if="label") {{ label }}
</template>
<script>
import bPopover from 'bootstrap-vue/lib/components/popover';
import { mapState } from 'client/libs/store';
export default {
components: {
bPopover,
},
props: {
item: {
type: Object,
},
itemContentClass: {
type: String,
},
label: {
type: String,
},
emptyItem: {
type: Boolean,
default: false,
},
popoverPosition: {
type: String,
default: 'bottom',
},
},
computed: {
...mapState({
ATTRIBUTES: 'constants.ATTRIBUTES',
}),
},
methods: {
click () {
this.$emit('click', this.item);
},
},
};
</script>