mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-12 03:38:07 +00:00
docs: mention adding auto-import of third party packages (#22575)
This commit is contained in:
parent
26bb507a45
commit
a88d3f3ccd
@ -140,3 +140,26 @@ export default defineNuxtConfig({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Auto-import from third-party packages
|
||||||
|
|
||||||
|
Nuxt also allows auto-importing from third-party packages.
|
||||||
|
|
||||||
|
::alert
|
||||||
|
If you are using the Nuxt module for that package, it is likely that the module has already configured auto-imports for that package.
|
||||||
|
::
|
||||||
|
|
||||||
|
For example, you could enable the auto-import of the `useI18n` composable from the `vue-i18n` package like this:
|
||||||
|
|
||||||
|
```ts [nuxt.config.ts]
|
||||||
|
export default defineNuxtConfig({
|
||||||
|
imports: {
|
||||||
|
presets: [
|
||||||
|
{
|
||||||
|
from: 'vue-i18n',
|
||||||
|
imports: ['useI18n']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user