2021-09-27 08:42:13 +00:00
|
|
|
<template>
|
|
|
|
<span :class="classList" :style="styleList">
|
|
|
|
<slot v-if="type != 'dot'"></slot>
|
|
|
|
</span>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup name="LayBadge" lang="ts">
|
2021-09-29 09:22:33 +00:00
|
|
|
import { defineProps } from 'vue'
|
2021-09-27 08:42:13 +00:00
|
|
|
|
|
|
|
const props =
|
|
|
|
defineProps<{
|
2021-09-30 16:48:51 +00:00
|
|
|
type?: string
|
|
|
|
theme?: string
|
|
|
|
color?: string
|
2021-09-27 08:42:13 +00:00
|
|
|
}>()
|
|
|
|
|
|
|
|
const classList = [{
|
|
|
|
'layui-badge': !props.type,
|
|
|
|
'layui-badge-dot': props.type == 'dot',
|
|
|
|
'layui-badge-rim': props.type == 'rim',
|
|
|
|
},
|
|
|
|
'layui-bg-' + props.theme];
|
|
|
|
|
|
|
|
const styleList = props.color ? 'background-color: ' + props.color : '';
|
|
|
|
|
|
|
|
</script>
|