Nuxt/test/fixtures/basic/pages/fn-midd.vue
2017-11-03 17:14:05 +01:00

18 lines
305 B
Vue

<template>
<h1>Date: {{ date }}</h1>
</template>
<script>
let date
export default {
middleware: ({ query, error }) => {
if (!query.please) return error({ message: 'You need to ask the permission', statusCode: 403 })
date = Date.now()
},
asyncData() {
return { date }
}
}
</script>