颜色模式头像

化身GitHub
一个阿凡达与不同的来源为光明和黑暗模式。

用法

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

使用light和dark道具定义亮暗模式的光源。

<template>
  <UColorModeAvatar light="https://github.com/vuejs.png" dark="https://github.com/nuxt.png" />
</template>
在亮模式和暗模式之间切换以查看不同的图像::u-color-mode-select{size="sm"}

API

Props

Prop Default Type
as
'span'
any

The element or component this component should render as.

light
string
dark
string
color
'neutral'
"primary" | "secondary" | "success" | "info" | "warning" | "error" | "neutral"
alt
string
decoding
"async" | "auto" | "sync"
height
string | number
loading
"lazy" | "eager"
referrerpolicy
"" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url"
sizes
string
srcset
string
usemap
string
width
string | number
crossorigin
"anonymous" | "use-credentials"
icon
any
text
string
size
'md'
"md" | "3xs" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl"
chip
boolean | ChipProps
ui
{ root?: SlotClass; image?: SlotClass; fallback?: SlotClass; icon?: SlotClass; }
此组件还支持所有原生<img> HTML属性。

Changelog

No recent changes