✨(component): 优化 avatar 组件代码结构
This commit is contained in:
parent
fba376bba7
commit
3beac422be
@ -38,10 +38,8 @@ const classes = computed(() => {
|
||||
<span :class="classes" v-if="slot.default">
|
||||
<slot></slot>
|
||||
</span>
|
||||
<span v-else-if="src" :class="classes">
|
||||
<img :alt="alt" :src="src" />
|
||||
</span>
|
||||
<span v-else :class="classes">
|
||||
<lay-icon :type="icon"></lay-icon>
|
||||
<img v-if="src" :src="src" :alt="alt" />
|
||||
<lay-icon v-else :type="icon" />
|
||||
</span>
|
||||
</template>
|
||||
|
@ -1,16 +1,15 @@
|
||||
<script lang="ts">
|
||||
import { computed, CSSProperties, useSlots, useAttrs } from "vue";
|
||||
export default {
|
||||
name: "LayAvatarList",
|
||||
};
|
||||
</script>
|
||||
|
||||
<script setup lang="ts">
|
||||
const slot = useSlots();
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="layui-avatar-list">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
Loading…
Reference in New Issue
Block a user