Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/runtime/components/NuxtPicture.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ import { markFeatureUsage } from '../utils/performance'
import { useImage } from '../composables'
import { useImageProps } from '../utils/props'
import type { BaseImageProps } from '../utils/props'
import type { DataAttributes } from '../../types/image'
import type { ConfiguredImageProviders, ProviderDefaults } from '@nuxt/image'

import { useHead, useNuxtApp, useRequestEvent } from '#imports'

export interface PictureProps<Provider extends keyof ConfiguredImageProviders> extends BaseImageProps<Provider> {
legacyFormat?: string
imgAttrs?: ImgHTMLAttributes
imgAttrs?: ImgHTMLAttributes & DataAttributes
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Vue itself might expose the types we need here

we did something similar for NuxtLink recently

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the first place I looked, but I couldn't find the correct type.

image

In NuxtLink I see a type used from vue-router, but that would not be applicable I think.

}

defineOptions({ inheritAttrs: false })
Expand Down
2 changes: 2 additions & 0 deletions src/types/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,5 @@ export interface ImageSizesVariant {
_cWidth: number
_cHeight?: number | undefined
}

export type DataAttributes = Record<`data-${string}`, string>
Loading