fix(nuxt): add refresh type in server component refs (#27778)

This commit is contained in:
Julien Huang 2024-06-24 11:42:03 +02:00 committed by GitHub
parent 2a01abf11d
commit 4dd71b6f2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -112,7 +112,7 @@ export const componentsTypeTemplate = {
] ]
}) })
const islandType = 'type IslandComponent<T extends DefineComponent> = T & DefineComponent<{}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, SlotsType<{ fallback: { error: unknown } }>>' const islandType = 'type IslandComponent<T extends DefineComponent> = T & DefineComponent<{}, {refresh: () => Promise<void>}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, SlotsType<{ fallback: { error: unknown } }>>'
return ` return `
import type { DefineComponent, SlotsType } from 'vue' import type { DefineComponent, SlotsType } from 'vue'
${nuxt.options.experimental.componentIslands ? islandType : ''} ${nuxt.options.experimental.componentIslands ? islandType : ''}