mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-23 22:25:12 +00:00
Polish app/server.js
This commit is contained in:
parent
78400042ef
commit
f07d9855b6
@ -153,7 +153,8 @@ export default async context => {
|
|||||||
if (typeof Component.options.validate !== 'function') return
|
if (typeof Component.options.validate !== 'function') return
|
||||||
isValid = Component.options.validate({
|
isValid = Component.options.validate({
|
||||||
params: context.route.params || {},
|
params: context.route.params || {},
|
||||||
query: context.route.query || {}<%= (store ? ', store: ctx.store' : '') %>
|
query: context.route.query || {},
|
||||||
|
<%= (store ? 'store: ctx.store' : '') %>
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
// ...If .validate() returned false
|
// ...If .validate() returned false
|
||||||
@ -195,7 +196,7 @@ export default async context => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Promise.all(promises).then(data => {
|
return Promise.all(promises).then(data => {
|
||||||
// If not dyanmic component, return data directly
|
// If no dynamic component, return data directly
|
||||||
if (Object.keys(_this.components).length === 0) {
|
if (Object.keys(_this.components).length === 0) {
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user