mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-18 09:25:54 +00:00
chore: update
This commit is contained in:
parent
4b85c83812
commit
e50a7e43fb
@ -86,15 +86,22 @@ export function createNuxt (options: NuxtOptions): Nuxt {
|
|||||||
|
|
||||||
const proxied = onChange(
|
const proxied = onChange(
|
||||||
options,
|
options,
|
||||||
(keys, value, previousValue, applyData) => {
|
(keys, newValue, previousValue, applyData) => {
|
||||||
if (value === previousValue && !applyData) {
|
if (newValue === previousValue && !applyData) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
let value = applyData?.args ?? newValue
|
||||||
|
// Make a shallow copy of the value
|
||||||
|
if (Array.isArray(value)) {
|
||||||
|
value = [...value]
|
||||||
|
} else if (typeof value === 'object') {
|
||||||
|
value = { ...(value as any) }
|
||||||
|
}
|
||||||
nuxt._debug!.moduleMutationRecords!.push({
|
nuxt._debug!.moduleMutationRecords!.push({
|
||||||
module: currentModule,
|
module: currentModule,
|
||||||
keys,
|
keys,
|
||||||
target: 'nuxt.options',
|
target: 'nuxt.options',
|
||||||
value: applyData?.args ?? value,
|
value,
|
||||||
timestamp: Date.now(),
|
timestamp: Date.now(),
|
||||||
method: applyData?.name,
|
method: applyData?.name,
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user