diff --git a/lib/app/client.js b/lib/app/client.js index 0e4ee34a3b..759fdb58b2 100644 --- a/lib/app/client.js +++ b/lib/app/client.js @@ -270,11 +270,7 @@ async function render (to, from, next) { Components.forEach(Component => { if (!isValid) return if (typeof Component.options.validate !== 'function') return - isValid = Component.options.validate({ - params: to.params || {}, - query : to.query || {}, - <% if(store) { %>store<% } %> - }) + isValid = Component.options.validate(app.context) }) // ...If .validate() returned false if (!isValid) { diff --git a/lib/app/server.js b/lib/app/server.js index ec684d155a..8c74946b73 100644 --- a/lib/app/server.js +++ b/lib/app/server.js @@ -156,11 +156,7 @@ export default async ssrContext => { Components.forEach((Component) => { if (!isValid) return if (typeof Component.options.validate !== 'function') return - isValid = Component.options.validate({ - params: app.context.route.params || {}, - query: app.context.route.query || {}, - <%= (store ? 'store' : '') %> - }) + isValid = Component.options.validate(app.context) }) // ...If .validate() returned false if (!isValid) {