mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-11 23:07:16 +00:00
e7cc2757c3
Co-authored-by: Alexander Lichter <manniL@gmx.net>
30 lines
514 B
Vue
30 lines
514 B
Vue
<template>
|
|
<div class="container">
|
|
<img :src="thumbnailUrl">
|
|
<p>
|
|
<NuxtLink to="/">
|
|
Home
|
|
</NuxtLink> - About
|
|
</p>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import axios from 'axios'
|
|
|
|
export default {
|
|
asyncData () {
|
|
const nb = Math.max(1, Math.round(Math.random() * 10))
|
|
return axios.get(`https://jsonplaceholder.typicode.com/photos/${nb}`).then(res => res.data)
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.container {
|
|
text-align: center;
|
|
padding-top: 100px;
|
|
font-family: sans-serif;
|
|
}
|
|
</style>
|