mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-18 14:41:25 +00:00
feat(docs): add description for kit'sinstallModule
This commit is contained in:
parent
9741f267be
commit
4daa626e85
@ -14,7 +14,29 @@ description: Nuxt Kit provides composable utilities to help interacting with Nux
|
||||
|
||||
[source code](https://github.com/nuxt/nuxt/blob/main/packages/kit/src/module)
|
||||
|
||||
- `installModule(module, inlineOptions)`
|
||||
#### `installModule(module, inlineOptions)`
|
||||
|
||||
Install specified Nuxt module programmatically. This is helpful when your module depends on other modules. You can pass the module options as an object to `inlineOptions` and they will be passed to the module's `setup` function.
|
||||
|
||||
```ts
|
||||
import { defineNuxtModule, installModule } from '@nuxt/kit'
|
||||
|
||||
export default defineNuxtModule<ModuleOptions>({
|
||||
async setup (options, nuxt) {
|
||||
// will install @nuxtjs/fontaine with Roboto font and Impact fallback
|
||||
await installModule('@nuxtjs/fontaine', {
|
||||
// module configuration
|
||||
fonts: [
|
||||
{
|
||||
family: 'Roboto',
|
||||
fallbacks: ['Impact'],
|
||||
fallbackName: 'fallback-a',
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
### Programmatic Usage
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user