mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
Fix validate in children
This commit is contained in:
parent
37e7a01955
commit
f335c8bd03
@ -80,9 +80,11 @@ function render (to, from, next) {
|
||||
this.setTransitions(mapTransitions(Components, to, from))
|
||||
this.error()
|
||||
let nextCalled = false
|
||||
let isValid = Components.some((Component) => {
|
||||
if (typeof Component.options.validate !== 'function') return true
|
||||
return Component.options.validate({
|
||||
let isValid = true
|
||||
Components.forEach((Component) => {
|
||||
if (!isValid) return
|
||||
if (typeof Component.options.validate !== 'function') return
|
||||
isValid = Component.options.validate({
|
||||
params: to.params || {},
|
||||
query: to.query || {}
|
||||
})
|
||||
|
@ -74,9 +74,11 @@ export default context => {
|
||||
return Component
|
||||
})
|
||||
// Call .validate()
|
||||
let isValid = Components.some((Component) => {
|
||||
if (typeof Component.options.validate !== 'function') return true
|
||||
return Component.options.validate({
|
||||
let isValid = true
|
||||
Components.forEach((Component) => {
|
||||
if (!isValid) return
|
||||
if (typeof Component.options.validate !== 'function') return
|
||||
isValid = Component.options.validate({
|
||||
params: context.route.params || {},
|
||||
query: context.route.query || {}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user