Nuxt/docs/3.api/3.utils/update-app-config.md

28 lines
627 B
Markdown
Raw Permalink Normal View History

---
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
---
::note
Updates the [`app.config`](/docs/guide/directory-structure/app-config) using deep assignment. Existing (nested) properties will be preserved.
::
## Usage
```js
2023-06-05 15:03:06 +00:00
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"}