mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-17 11:15:14 +00:00
36 lines
561 B
Vue
36 lines
561 B
Vue
|
|
<template>
|
|
<div class="container">
|
|
<h1>User Agent</h1>
|
|
<p>{{ userAgent }}</p>
|
|
<p>
|
|
<NuxtLink to="/posts">
|
|
Blog
|
|
</NuxtLink>
|
|
</p>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
asyncData: ({ req }) => ({
|
|
userAgent: (req ? req.headers['user-agent'] : (typeof navigator !== 'undefined' ? navigator.userAgent : 'No user agent (generated)'))
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.container {
|
|
width: 70%;
|
|
margin: auto;
|
|
text-align: center;
|
|
padding-top: 100px;
|
|
}
|
|
p {
|
|
font-size: 20px;
|
|
}
|
|
a {
|
|
color: #41B883;
|
|
}
|
|
</style>
|