mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-16 13:48:13 +00:00
docs: auto imports don't work in server/api
(#3330)
This commit is contained in:
parent
a358bdad93
commit
ed411c687d
@ -1,6 +1,6 @@
|
||||
# Auto imports
|
||||
|
||||
Nuxt auto-imports helper functions, composables and Vue APIs to use across your application without explicitly importing them. Based on the directory structure, every Nuxt application can also use auto-imports for its own components, composables and plugins.
|
||||
Nuxt auto-imports helper functions, composables and Vue APIs to use across your application without explicitly importing them. Based on the directory structure, every Nuxt application can also use auto-imports for its own components, composables and plugins. These functions can be used in components, composables or plugins. However, auto imports don't currently work within the server scope. They just work within the Vue portion of your app.
|
||||
|
||||
Contrary to a classic global declaration, Nuxt preserves typings and IDEs completions and hints, and only includes what is actually used in your production code.
|
||||
|
||||
@ -16,8 +16,6 @@ Contrary to a classic global declaration, Nuxt preserves typings and IDEs comple
|
||||
|
||||
Nuxt auto-imports functions and composables to perform [data fetching](/docs/usage/data-fetching), get access to the [app context](/docs/usage/nuxt-app) and [runtime config](/docs/usage/runtime-config), manage [state](/docs/usage/state) or define components and plugins.
|
||||
|
||||
These functions can be used in components, composables or plugins.
|
||||
|
||||
```vue
|
||||
<script setup>
|
||||
/* useAsyncData() and $fetch() are auto-imported */
|
||||
|
Loading…
Reference in New Issue
Block a user