Background.vue 477 字节
Newer Older
L
LeoKu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<template>
  <div class="avatar-background" :style="{ background: props.color }"></div>
</template>

<script lang="ts" setup>
import type { AvatarOption } from '../../types'

interface BackgroundProps {
  color: AvatarOption['background']['color']
}

const props = defineProps<BackgroundProps>()
</script>

<style lang="scss" scoped>
.avatar-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: background-color 0.1s;
}
</style>