mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 16:12:12 +00:00
34 lines
579 B
Vue
34 lines
579 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>
|