ColorModeImage
具有不同光源的图像元素用于亮模式和暗模式。
用法
ColorModeImage组件在安装@nuxt/image时使用<NuxtImg>组件,否则回退到img。
<template>
<UColorModeImage
light="https://picsum.photos/id/29/400"
dark="https://picsum.photos/id/46/400"
:width="200"
:height="200"
/>
</template>在亮模式和暗模式之间切换以查看不同的图像::u-color-mode-select{size="sm"}
API
Props
| Prop | Default | Type |
|---|---|---|
dark | string | |
light | string | |
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" |
Changelog
No recent changes