mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 01:17:16 +00:00
2956e73c3e
- Loading component working and customisable via nuxt.config.js (see examples/async-data/) - Accept callback for new Nuxt(options, cb) with cb(null, nuxt) - Simplify async-data example
30 lines
459 B
Vue
30 lines
459 B
Vue
|
|
<template>
|
|
<div>
|
|
<p>{{ post.title }}!</p>
|
|
<p><router-link to="/">Back home</router-link></p>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
const axios = require('axios')
|
|
|
|
export default {
|
|
data ({ req }) {
|
|
return axios.get('https://jsonplaceholder.typicode.com/posts/1')
|
|
.then((res) => {
|
|
return { post: res.data }
|
|
})
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
p {
|
|
font-size: 20px;
|
|
text-align: center;
|
|
padding: 100px;
|
|
padding-bottom: 0;
|
|
}
|
|
</style>
|