Skip to content
This repository was archived by the owner on Sep 24, 2025. It is now read-only.

Commit 869f61e

Browse files
authored
fix(config): replace new value if config is an array (#143)
1 parent d6090df commit 869f61e

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/runtime/composables/useStudio.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { createApp, nextTick } from 'vue'
1+
import { createApp } from 'vue'
22
import type { Storage } from 'unstorage'
33
import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
4-
import { defu } from 'defu'
4+
import { createDefu } from 'defu'
55
import type { RouteLocationNormalized } from 'vue-router'
66
import ContentPreviewMode from '../components/ContentPreviewMode.vue'
77
import { createSingleton, deepAssign, deepDelete, mergeDraft, StudioConfigFiles } from '../utils'
@@ -11,6 +11,13 @@ import { useAppConfig, useNuxtApp, useRuntimeConfig, useState, useContentState,
1111

1212
const useDefaultAppConfig = createSingleton(() => JSON.parse(JSON.stringify((useAppConfig()))))
1313

14+
const defu = createDefu((obj, key, value) => {
15+
if (Array.isArray(obj[key]) && Array.isArray(value)) {
16+
obj[key] = value
17+
return true
18+
}
19+
})
20+
1421
export const useStudio = () => {
1522
const nuxtApp = useNuxtApp()
1623
const { studio: studioConfig, content: contentConfig } = useRuntimeConfig().public

0 commit comments

Comments
 (0)