ColorModeImagePRO

一个在亮色和暗色模式下显示不同图片的图片元素。

用法

@nuxt/image已安装时,ColorModeImage 组件使用 <NuxtImg> 组件,否则会回退到 img

<template>
  <UColorModeImage
    light="https://picsum.photos/id/29/400"
    dark="https://picsum.photos/id/46/400"
    :width="200"
    :height="200"
  />
</template>
在亮色和暗色模式之间切换以查看不同的图片

API

属性

属性默认值类型
亮色

string

暗色

string