Files
vue-tippy/docs/components/global/FeatureList.vue
T
Georges KABBOUCHI 6a64cd616f docs
2021-01-02 22:00:55 +02:00

76 lines
1.3 KiB
Vue

<template>
<div>
<div
v-for="(item, i) in items"
:key="i"
class="mt-3 flex"
>
<span
:class="`list-${type}`"
class="mt-px mr-3 flex-shrink-0"
>
<component
:is="iconName"
class="h-6 w-6"
/>
</span>
<div v-html="item"></div>
</div>
</div>
</template>
<script>
export default {
props: {
items: {
type: Array,
default: () => []
},
icon: {
type: String,
default: null
},
type: {
type: String,
default: 'primary',
validator(value) {
return ['primary', 'info', 'success', 'warning', 'danger'].includes(value)
}
}
},
computed: {
iconName() {
return this.icon || ({
primary: 'IconBadgeCheck',
info: 'IconInformationCircle',
success: 'IconCheckCircle',
warning: 'IconExclamationCircle',
danger: 'IconXCircle'
})[this.type]
}
}
}
</script>
<style>
/* Primary */
.list-primary {
@apply text-primary-500;
}
/* Info */
.list-info {
@apply text-blue-500;
}
/* Success */
.list-success {
@apply text-green-500;
}
/* Warning */
.list-warning {
@apply text-orange-500;
}
/* Danger */
.list-danger {
@apply text-red-500;
}
</style>