mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 15:42:09 +00:00
chore(kit): refactor some configs with defu (#1459)
This commit is contained in:
parent
d2cc9e4bd0
commit
3761b064d0
@ -247,18 +247,15 @@ export default {
|
||||
*/
|
||||
loadingIndicator: {
|
||||
$resolve: (val, get) => {
|
||||
if (typeof val === 'string') {
|
||||
val = { name: val }
|
||||
}
|
||||
return {
|
||||
val = typeof val === 'string' ? { name: val } : val
|
||||
return defu(val, {
|
||||
name: 'default',
|
||||
color: get('loading.color') || '#D3D3D3',
|
||||
color2: '#F5F5F5',
|
||||
background: (get('manifest') && get('manifest.theme_color')) || 'white',
|
||||
dev: get('dev'),
|
||||
loading: get('messages.loading'),
|
||||
...val
|
||||
}
|
||||
loading: get('messages.loading')
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
@ -272,14 +269,18 @@ export default {
|
||||
* @see [vue@3 documentation](https://v3.vuejs.org/guide/transitions-enterleave.html)
|
||||
* @version 2
|
||||
*/
|
||||
pageTransition: {
|
||||
$resolve: val => typeof val === 'string' ? { name: val } : val,
|
||||
name: 'page',
|
||||
mode: 'out-in',
|
||||
appear: { $resolve: (val, get) => (get('render.ssr') === false) ? true : Boolean(val) },
|
||||
appearClass: 'appear',
|
||||
appearActiveClass: 'appear-active',
|
||||
appearToClass: 'appear-to'
|
||||
pageTransition: {
|
||||
$resolve: (val, get) => {
|
||||
val = typeof val === 'string' ? { name: val } : val
|
||||
return defu(val, {
|
||||
name: 'page',
|
||||
mode: 'out-in',
|
||||
appear: get('render.ssr') === false || Boolean(val),
|
||||
appearClass: 'appear',
|
||||
appearActiveClass: 'appear-active',
|
||||
appearToClass: 'appear-to'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -293,9 +294,13 @@ export default {
|
||||
* @version 2
|
||||
*/
|
||||
layoutTransition: {
|
||||
$resolve: val => typeof val === 'string' ? { name: val } : val,
|
||||
name: 'layout',
|
||||
mode: 'out-in'
|
||||
$resolve: val => {
|
||||
val = typeof val === 'string' ? { name: val } : val
|
||||
return defu(val, {
|
||||
name: 'layout',
|
||||
mode: 'out-in'
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user