You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/vue/route-modules.md
+73-10Lines changed: 73 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -140,17 +140,80 @@ export default {
140
140
141
141
**`@fastify/vue`** renders `<head>` elements **independently** from SSR. This allows you to fetch data for populating `<meta>` tags first, stream them right away to the client, and only then perform SSR.
142
142
143
-
> Under the hood, it uses the [`unihead`](https://github.com/galvez/unihead) library, which has a SSR function and a browser library that allows for dynamic changes during client-side navigation. This is a very small library built specifically for `@fastify/vite` core renderers, and used in the current implementation of `createHtmlFunction()` for `@fastify/vue`. This may change in the futuree as other libraries are considered, but for most use cases it should be enough.
144
-
145
-
To populate `<title>`, `<meta>` and `<link>` elements, export a `getMeta()` function that returns an object matching the interface expected by [unihead](https://github.com/galvez/unihead):
143
+
To populate `<head>` elements, export a `getMeta()` function that returns an object matching the interface expected by [unhead](https://github.com/unjs/unhead):
146
144
147
145
```ts
148
-
interfaceRouteMeta {
149
-
title?:string|null,
150
-
html?:Record<string, string> |null
151
-
body?:Record<string, string> |null
152
-
meta?:Record<string, string>[] |null,
153
-
link?:Record<string, string>[] |null,
146
+
interfaceReactiveHead {
147
+
/**
148
+
* The `<title>` HTML element defines the document's title that is shown in a browser's title bar or a page's tab.
149
+
* It only contains text; tags within the element are ignored.
0 commit comments