[新增] avatar 头像组件

This commit is contained in:
就眠仪式
2021-10-01 20:22:49 +08:00
parent 899604b2d0
commit ddfca5b3c7
9 changed files with 172 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
<template>
<span :class="classList" :style="styleList">
<slot v-if="type != 'dot'"></slot>
</span>
<span :class="classList" :style="styleList">
<slot v-if="type != 'dot'"></slot>
</span>
</template>
<script setup name="LayBadge" lang="ts">
@@ -9,18 +9,19 @@ import { defineProps } from 'vue'
const props =
defineProps<{
type?: string
theme?: string
color?: string
type?: string
theme?: string
color?: string
}>()
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 : '';
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>