Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Commit 73afd9a

Browse files
authored
docs: note about nuxt metadata, close #11
1 parent 683b295 commit 73afd9a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,24 @@ export default {
6464
6565
Example: [`examples/nuxt`](./examples/nuxt)
6666

67+
###### Component Meta
68+
69+
Note that `<script setup>` could co-exist with `<script>`, if you want to define component metadata like `layout` or `head` for Nuxt, you can do it this way:
70+
71+
```html
72+
<script setup lang="ts">
73+
// your script setup
74+
</script>
75+
76+
<script lang="ts">
77+
// the normal script
78+
export default {
79+
layout: 'user',
80+
// ...other meta
81+
}
82+
</script>
83+
```
84+
6785
###### TypeScript
6886

6987
To use TypeScript with Nuxt, install the [`@nuxtjs/typescript-module`](https://typescript.nuxtjs.org/) but disable the type check:

0 commit comments

Comments
 (0)