mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
e7cc2757c3
Co-authored-by: Alexander Lichter <manniL@gmx.net>
34 lines
580 B
Vue
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>
|