Image (图片)
带骨架屏、宽高比与 object-fit 的图片;在 Nuxt 层下经由 @nuxt/image 渲染。
基础用法
Basic.vue
宽高比
AspectRatio.vue
填充方式
ObjectFit.vue
骨架屏
Skeleton.vue
ThumbHash 模糊占位(blur-up)
传入 thumbhash(后端随图片元数据下发的 ~25 字节 base64), 加载前即显示解码出的模糊占位、加载完成后淡出——比纯骨架屏更贴近最终画面,且零额外网络请求。 解码器仅在用到时才按需加载,客户端解码、SSR 安全。

BlurUp.vue
加载失败回退

Fallback.vue
懒加载与即时加载
Loading.vue
属性
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| src * | string | — | |
| alt | string | "image" | |
| ariaLabel | string | undefined | |
| aspectRatio | string | undefined | |
| className | string | undefined | |
| decoding | "auto" | "sync" | "async" | undefined | |
| densities | string | undefined | |
| fallbackSrc | string | undefined | |
| fetchpriority | "auto" | "high" | "low" | undefined | |
| format | string | undefined | |
| height | string | number | undefined | |
| imageClassName | string | undefined | |
| loading | "lazy" | "eager" | "lazy" | |
| objectFit | "fill" | "none" | "cover" | "contain" | "scale-down" | "cover" | |
| placeholder | string | number | boolean | [w: number, h: number, q?: number, b?: number] | undefined | |
| preload | boolean | { fetchPriority: "auto" | "high" | "low"; } | undefined | |
| provider | "none" | (string & {}) | "ipx" | undefined | |
| quality | string | number | undefined | |
| sizes | string | undefined | |
| skeleton | boolean | true | |
| thumbhash | string | undefined | A ThumbHash (base64) → a blurred "blur-up" placeholder shown until the image loads, then cross-faded out. Decoded to a tiny image on the client; falls back to the pulse skeleton until decoded (or if the hash is invalid). Implies the wrapper even with `skeleton: false`. |
| width | string | number | undefined |