mirror of
https://github.com/nuxt/nuxt.git
synced 2025-03-21 08:45:53 +00:00
chore: use logical or assignment (#30992)
This commit is contained in:
parent
ab1f21b481
commit
4fdaffb9ef
@ -517,7 +517,7 @@ export function tryUseNuxtApp (id?: string): NuxtApp | null {
|
|||||||
nuxtAppInstance = getCurrentInstance()?.appContext.app.$nuxt
|
nuxtAppInstance = getCurrentInstance()?.appContext.app.$nuxt
|
||||||
}
|
}
|
||||||
|
|
||||||
nuxtAppInstance = nuxtAppInstance || getNuxtAppCtx(id).tryUse()
|
nuxtAppInstance ||= getNuxtAppCtx(id).tryUse()
|
||||||
|
|
||||||
return nuxtAppInstance || null
|
return nuxtAppInstance || null
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ function pageToClientOnly<T extends ComponentOptions> (component: T) {
|
|||||||
if (isPromise(setupState)) {
|
if (isPromise(setupState)) {
|
||||||
return Promise.resolve(setupState).then((setupState: any) => {
|
return Promise.resolve(setupState).then((setupState: any) => {
|
||||||
if (typeof setupState !== 'function') {
|
if (typeof setupState !== 'function') {
|
||||||
setupState = setupState || {}
|
setupState ||= {}
|
||||||
setupState.mounted$ = mounted$
|
setupState.mounted$ = mounted$
|
||||||
return setupState
|
return setupState
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ export const ComposableKeysPlugin = (options: ComposableKeysOptions) => createUn
|
|||||||
const name = node.callee.name
|
const name = node.callee.name
|
||||||
if (!name || !keyedFunctions.has(name) || node.arguments.length >= maxLength) { return }
|
if (!name || !keyedFunctions.has(name) || node.arguments.length >= maxLength) { return }
|
||||||
|
|
||||||
imports = imports || detectImportNames(script, composableMeta)
|
imports ||= detectImportNames(script, composableMeta)
|
||||||
if (imports.has(name)) { return }
|
if (imports.has(name)) { return }
|
||||||
|
|
||||||
const meta = composableMeta[name]
|
const meta = composableMeta[name]
|
||||||
|
Loading…
Reference in New Issue
Block a user