Skip to content
Open
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
24 changes: 15 additions & 9 deletions docs/content/docs/1.getting-started/6.integrations/6.ssr.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import { createHead, renderSSRHead } from '@unhead/vue/server'
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'
import { createSSRApp, DefineComponent, h } from 'vue'
import { renderToString } from 'vue/server-renderer'
import PersistentLayout from './layouts/PersistentLayout.vue'

const appName = import.meta.env.VITE_APP_NAME || 'Laravel x Nuxt UI'

Expand Down Expand Up @@ -75,7 +74,6 @@ import { createHead, renderSSRHead } from '@unhead/vue/server'
import { resolvePageComponent } from '@adonisjs/inertia/helpers'
import { createSSRApp, DefineComponent, h } from 'vue'
import { renderToString } from 'vue/server-renderer'
import PersistentLayout from './layouts/PersistentLayout.vue'

const appName = import.meta.env.VITE_APP_NAME || 'AdonisJS x Nuxt UI'

Expand Down Expand Up @@ -144,10 +142,8 @@ if (theme === 'dark' || (theme === null && window.matchMedia('(prefers-color-sch
}
</script>
</head>
<body>
<div class="isolate">
@inertia
</div>
<body class="isolate">
@inertia
</body>
</html>
```
Expand All @@ -169,8 +165,8 @@ if (theme === 'dark' || (theme === null && window.matchMedia('(prefers-color-sch
}
</script>
</head>
<body>
@inertia({ class: 'isolate' })
<body class="isolate">
@inertia()
</body>
</html>
```
Expand All @@ -179,4 +175,14 @@ if (theme === 'dark' || (theme === null && window.matchMedia('(prefers-color-sch

### Icons Display

Unfortunately displaying icons with the SSR server of the Vue version is currently not supported. The icons will only be displayed after the application is initialized at the user's end.
For proper SSR support, pass the icon component directly rather than using a string identifier. This method is supported by any component accepting an icon prop.

```vue
<script setup lang="ts">
import IconLightbulb from '~icons/lucide/lightbulb'
</script>

<template>
<UIcon :name="IconLightbulb" class="size-5" />
</template>
```
Loading