mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-24 06:35:10 +00:00
28 lines
527 B
Vue
28 lines
527 B
Vue
<template>
|
|
<div>
|
|
<h1>{{ $route.params.slug || 'Home' }}</h1>
|
|
<pre>{{ userAgent }}</pre>
|
|
<ul>
|
|
<li><nuxt-link to="/">Home</nuxt-link></li>
|
|
<li v-for="(slug, index) in slugs" :key="index">
|
|
<nuxt-link :to="{ name: 'slug', params: { slug } }">{{ slug }}</nuxt-link>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
asyncData({ store, route, userAgent }) {
|
|
return {
|
|
userAgent,
|
|
slugs: [
|
|
'foo',
|
|
'bar',
|
|
'baz'
|
|
]
|
|
}
|
|
}
|
|
}
|
|
</script>
|