mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-24 14:45:15 +00:00
f26a801775
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Daniel Roe <daniel@roe.dev>
28 lines
630 B
Markdown
28 lines
630 B
Markdown
---
|
|
title: 'updateAppConfig'
|
|
description: 'Update the App Config at runtime.'
|
|
links:
|
|
- label: Source
|
|
icon: i-simple-icons-github
|
|
to: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/app/config.ts
|
|
size: xs
|
|
---
|
|
|
|
::callout
|
|
Updates the [`app.config`](/docs/guide/directory-structure/app-config) using deep assignment. Existing (nested) properties will be preserved.
|
|
::
|
|
|
|
## Usage
|
|
|
|
```js
|
|
const appConfig = useAppConfig() // { foo: 'bar' }
|
|
|
|
const newAppConfig = { foo: 'baz' }
|
|
|
|
updateAppConfig(newAppConfig)
|
|
|
|
console.log(appConfig) // { foo: 'baz' }
|
|
```
|
|
|
|
:read-more{to="/docs/guide/directory-structure/app-config"}
|