mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
fix(nuxt): ensure prerendered components are treated as islands (#21583)
This commit is contained in:
parent
c73bed8c6d
commit
2a42a5f807
@ -79,6 +79,7 @@ export default defineComponent({
|
||||
}
|
||||
// TODO: Validate response
|
||||
const result = await $fetch<NuxtIslandResponse>(url, {
|
||||
responseType: 'json',
|
||||
params: {
|
||||
...props.context,
|
||||
props: props.props ? JSON.stringify(props.props) : undefined
|
||||
|
@ -20,7 +20,10 @@ if (componentIslands) {
|
||||
revivers.Island = ({ key, params }: any) => {
|
||||
const nuxtApp = useNuxtApp()
|
||||
if (!nuxtApp.isHydrating) {
|
||||
nuxtApp.payload.data[key] = nuxtApp.payload.data[key] || $fetch(`/__nuxt_island/${key}`, params ? { params } : {}).then((r) => {
|
||||
nuxtApp.payload.data[key] = nuxtApp.payload.data[key] || $fetch(`/__nuxt_island/${key}`, {
|
||||
responseType: 'json',
|
||||
...params ? { params } : {}
|
||||
}).then((r) => {
|
||||
nuxtApp.payload.data[key] = r
|
||||
return r
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user