docs: use `defineEventHandler()` to avoid warnings (#18557)

Avoid the warning:

> [h3] Implicit event handler conversion is deprecated. Use `eventHandler()` or `fromNodeMiddleware()` to define event handlers.
This commit is contained in:
华晨 2023-01-26 23:49:32 +08:00 committed by GitHub
parent 5c7715813d
commit 64b835c707
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -83,10 +83,10 @@ In brief, `useFetch` receives a URL and gets that data, whereas `useAsyncData` m
```ts [server/api/count.ts]
let counter = 0
export default () => {
export default defineEventHandler(() => {
counter++
return JSON.stringify(counter)
}
})
```
```vue [app.vue]