maxkb/ui/src/components/app-avatar/index.vue
wangdan-fit2cloud 64284b18db feat: 数据集
2023-10-25 18:35:28 +08:00

21 lines
415 B
Vue

<template>
<el-avatar :size="30" v-bind="$attrs">
<slot> {{ firstUserName }} </slot>
</el-avatar>
</template>
<script setup lang="ts">
import { computed } from 'vue'
defineOptions({ name: 'AppAvatar' })
const props = defineProps({
name: {
type: String,
default: ''
}
})
const firstUserName = computed(() => {
return props.name?.substring(0, 1)
})
</script>
<style lang="scss" scoped></style>