refactor(nuxt): simplify runtimeConfig initialization of client side (#26558)

This commit is contained in:
Alex Liu 2024-03-30 15:48:43 +08:00 committed by GitHub
parent f00dcdf0f8
commit 8eef1e3c57
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -338,7 +338,7 @@ export function createNuxtApp (options: CreateOptions) {
} }
// Expose runtime config // Expose runtime config
const runtimeConfig = import.meta.server ? options.ssrContext!.runtimeConfig : reactive(nuxtApp.payload.config!) const runtimeConfig = import.meta.server ? options.ssrContext!.runtimeConfig : nuxtApp.payload.config!
nuxtApp.provide('config', runtimeConfig) nuxtApp.provide('config', runtimeConfig)
return nuxtApp return nuxtApp