mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-27 14:57:08 +08:00
first commit
This commit is contained in:
31
src/components/GiCell/GiCellAvatar.vue
Normal file
31
src/components/GiCell/GiCellAvatar.vue
Normal file
@@ -0,0 +1,31 @@
|
||||
<template>
|
||||
<a-space fill>
|
||||
<a-avatar :size="24" shape="circle">
|
||||
<img :src="props.avatar" alt="avatar" />
|
||||
</a-avatar>
|
||||
<a-link v-if="props.isLink" @click="emit('click')">{{ props.name }}</a-link>
|
||||
<span v-else>{{ props.name }}</span>
|
||||
</a-space>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
defineOptions({ name: 'GiCellAvatar' })
|
||||
|
||||
interface Props {
|
||||
avatar: string
|
||||
name: string
|
||||
isLink?: boolean
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
avatar: '',
|
||||
name: '',
|
||||
isLink: false // 是否可以点击
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'click'): void
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
Reference in New Issue
Block a user