-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathchip_default.story.vue
More file actions
53 lines (51 loc) · 1.13 KB
/
chip_default.story.vue
File metadata and controls
53 lines (51 loc) · 1.13 KB
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
<!-- eslint-disable vue/no-v-text-v-html-on-component -->
<template>
<dt-chip
:id="$attrs.id"
:hide-close="$attrs.hideClose"
:interactive="$attrs.interactive"
:size="$attrs.size"
:aria-label="$attrs.ariaLabel"
:content-class="$attrs.contentClass"
@click="$attrs.onClick"
@close="$attrs.onClose"
>
<template
v-if="$attrs.icon"
slot="icon"
>
<dt-icon
:name="$attrs.icon"
:size="iconSize"
/>
</template>
<template
v-else-if="$attrs.avatar"
slot="avatar"
>
<dt-avatar
:full-name="$attrs.avatar"
:seed="$attrs.avatarSeed"
/>
</template>
<span
v-if="$attrs.default"
v-html="$attrs.default"
/>
</dt-chip>
</template>
<script>
import DtChip from './chip.vue';
import { CHIP_ICON_SIZES } from './chip_constants.js';
import { DtIcon } from '@/components/icon';
import { DtAvatar } from '@/components/avatar';
export default {
name: 'DtChipDefault',
components: { DtAvatar, DtChip, DtIcon },
computed: {
iconSize () {
return CHIP_ICON_SIZES[this.$attrs.size];
},
},
};
</script>