mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
30 lines
506 B
Vue
30 lines
506 B
Vue
|
|
<template>
|
|
<div>
|
|
<p>{{ userAgent }}</p>
|
|
<p><nuxt-link to="/post">See a post (http request / Ajax)</nuxt-link></p>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data ({ req }, callback) {
|
|
setTimeout(function () {
|
|
// callback(err, data)
|
|
callback(null, {
|
|
userAgent: (req ? req.headers['user-agent'] : navigator.userAgent)
|
|
})
|
|
}, 100)
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
p {
|
|
font-size: 20px;
|
|
text-align: center;
|
|
padding: 100px;
|
|
padding-bottom: 0;
|
|
}
|
|
</style>
|