[新增] 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

@@ -0,0 +1,9 @@
import type { App } from 'vue'
import Component from './index.vue'
import type { IDefineComponent } from '../type/index'
Component.install = (app: App) => {
app.component(Component.name || 'LayAvatar', Component)
}
export default Component as IDefineComponent

View File

@@ -0,0 +1,14 @@
<template>
<img :src="src" class="layui-avatar" :class="[radius ? 'layui-avatar-radius':'', size ? 'layui-avatar-' + size: '']"/>
</template>
<script setup name="LayAvatar" lang="ts">
import { defineProps } from 'vue'
const props =
defineProps<{
src?: boolean
radius?: boolean
size?: string
}>()
</script>