Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0e4f174

Browse files
committed
feat: add type for default nuxt-picture slots
1 parent 6fe8401 commit 0e4f174

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/runtime/components/NuxtPicture.vue

+10
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,16 @@ const attrs = computed(() => {
7979
return attrs
8080
})
8181
82+
interface DefaultSlotProps {
83+
imgAttrs: Record<string, unknown>
84+
isLoaded: boolean
85+
src?: string
86+
}
87+
88+
defineSlots<{
89+
default: (props: DefaultSlotProps) => any
90+
}>()
91+
8292
const originalFormat = computed(() => getFileExtension(props.src))
8393
const isTransparent = computed(() => ['png', 'webp', 'gif', 'svg'].includes(originalFormat.value))
8494

0 commit comments

Comments
 (0)