颜色模式图片
一个在亮色和暗色模式下具有不同图片源的图像元素。
用法
ColorModeImage 组件在使用时会使用 `<NuxtImg>
` 组件,@nuxt/image
如果未安装,则回退使用 `` 标签。
<template>
<UColorModeImage
light="https://picsum.photos/id/29/400"
dark="https://picsum.photos/id/46/400"
:width="200"
:height="200"
/>
</template>
在浅色和深色模式之间切换,查看不同的图片
API
属性
属性 | 默认值 | 类型 |
---|---|---|
深色模式 |
| |
浅色模式 |
|
更新日志
5cb65
— 特性:导入 @nuxt/ui-pro
组件