Nuxt/examples/middleware/pages/_slug.vue
pooya parsa e7cc2757c3 refactor: update eslint-config to 1.x
Co-authored-by: Alexander Lichter <manniL@gmx.net>
2019-07-10 15:15:49 +04:30

34 lines
580 B
Vue

<template>
<div>
<h1>{{ $route.params.slug || 'Home' }}</h1>
<pre>{{ userAgent }}</pre>
<ul>
<li>
<NuxtLink to="/">
Home
</NuxtLink>
</li>
<li v-for="(slug, index) in slugs" :key="index">
<NuxtLink :to="{ name: 'slug', params: { slug } }">
{{ slug }}
</NuxtLink>
</li>
</ul>
</div>
</template>
<script>
export default {
asyncData ({ store, route, userAgent }) {
return {
userAgent,
slugs: [
'foo',
'bar',
'baz'
]
}
}
}
</script>