ColorModeAvatarPRO

AvatarGitHub
一个在浅色和深色模式下具有不同来源的头像。

用法

ColorModeAvatar 组件扩展了 Avatar 组件,因此您可以传递任何属性,例如 sizeicon 等。

使用 lightdark 属性来定义亮色和暗色模式的来源。

<template>
  <UColorModeAvatar light="https://github.com/vuejs.png" dark="https://github.com/nuxt.png" />
</template>
切换亮色和暗色模式以查看不同的图像

API

属性

属性默认值类型
as

'span'

any

此组件应渲染为的元素或组件。

light

string

dark

string

图标

string

尺寸

'md'

"md" | "xs" | "sm" | "lg" | "xl" | "3xs" | "2xs" | "2xl" | "3xl"

alt

string

chip

boolean | ChipProps

文本

string

ui

{ root?: ClassNameValue; image?: ClassNameValue; fallback?: ClassNameValue; icon?: ClassNameValue; }