diff --git a/examples/middleware/middleware/visits.js b/examples/middleware/middleware/visits.js index 3ba5ab253f..719079c5bd 100644 --- a/examples/middleware/middleware/visits.js +++ b/examples/middleware/middleware/visits.js @@ -1,3 +1,4 @@ -export default function ({ store, route }) { +export default function ({ store, route, redirect }) { store.commit('ADD_VISIT', route.path) + if (route.fullPath === '/') return redirect('/foo') } diff --git a/examples/middleware/pages/_slug.vue b/examples/middleware/pages/_slug.vue index 4fbd6b57c5..57c3d2a228 100644 --- a/examples/middleware/pages/_slug.vue +++ b/examples/middleware/pages/_slug.vue @@ -12,6 +12,7 @@