Skip to content

Commit 2126ea0

Browse files
committed
docs: eslint + definePage
See #511
1 parent 6e5ae6b commit 2126ea0

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

docs/guide/eslint.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,15 @@ If you are not using auto imports, you will need to tell ESlint about `vue-route
99
}
1010
}
1111
```
12+
13+
## `definePage()`
14+
15+
Since `definePage()` is a global macro, you need to tell ESlint about it. Add these lines to your eslint configuration:
16+
17+
```json{3}
18+
{
19+
"globals": {
20+
"definePage": "readonly"
21+
}
22+
}
23+
```

docs/guide/extending-routes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ definePage({
6666
</template>
6767
```
6868

69+
If you are using ESLint, you will need [to declare it as a global variable](../guide/eslint.md#definepage).
70+
6971
::: danger
7072
You cannot use variables in `definePage()` as its passed parameter gets extracted at build time and is removed from `<script setup>`. Similar to other macros like `definePageMeta()` in Nuxt.
7173
:::

0 commit comments

Comments
 (0)