✨(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">
|
<span :class="classes" v-if="slot.default">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="src" :class="classes">
|
|
||||||
<img :alt="alt" :src="src" />
|
|
||||||
</span>
|
|
||||||
<span v-else :class="classes">
|
<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>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, CSSProperties, useSlots, useAttrs } from "vue";
|
|
||||||
export default {
|
export default {
|
||||||
name: "LayAvatarList",
|
name: "LayAvatarList",
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
const slot = useSlots();
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
Loading…
Reference in New Issue
Block a user