Nuxt/test/fixtures/basic/pages/fn-midd.vue

18 lines
310 B
Vue
Raw Normal View History

2017-11-03 16:14:05 +00:00
<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 }) }
2017-11-03 16:14:05 +00:00
date = Date.now()
},
asyncData () {
2017-11-03 16:14:05 +00:00
return { date }
}
}
</script>