mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-19 23:21:09 +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.setTransitions(mapTransitions(Components, to, from))
|
||||||
this.error()
|
this.error()
|
||||||
let nextCalled = false
|
let nextCalled = false
|
||||||
let isValid = Components.some((Component) => {
|
let isValid = true
|
||||||
if (typeof Component.options.validate !== 'function') return true
|
Components.forEach((Component) => {
|
||||||
return Component.options.validate({
|
if (!isValid) return
|
||||||
|
if (typeof Component.options.validate !== 'function') return
|
||||||
|
isValid = Component.options.validate({
|
||||||
params: to.params || {},
|
params: to.params || {},
|
||||||
query: to.query || {}
|
query: to.query || {}
|
||||||
})
|
})
|
||||||
|
@ -74,9 +74,11 @@ export default context => {
|
|||||||
return Component
|
return Component
|
||||||
})
|
})
|
||||||
// Call .validate()
|
// Call .validate()
|
||||||
let isValid = Components.some((Component) => {
|
let isValid = true
|
||||||
if (typeof Component.options.validate !== 'function') return true
|
Components.forEach((Component) => {
|
||||||
return Component.options.validate({
|
if (!isValid) return
|
||||||
|
if (typeof Component.options.validate !== 'function') return
|
||||||
|
isValid = Component.options.validate({
|
||||||
params: context.route.params || {},
|
params: context.route.params || {},
|
||||||
query: context.route.query || {}
|
query: context.route.query || {}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user