使用法
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' | anyThe 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; } |
Changelog
No recent changes