mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-29 23:02:42 +00:00
Fix path and add random image
This commit is contained in:
parent
592f8cc733
commit
ebb67243c8
@ -4,6 +4,6 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
// ssr: false to only include it on client-side
|
// ssr: false to only include it on client-side
|
||||||
{ src: '~plugins/vue-notifications.js', ssr: false }
|
{ src: '~/plugins/vue-notifications.js', ssr: false }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "nuxt-plugins-vendor",
|
"name": "nuxt-plugins-vendor",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^0.15.2",
|
"axios": "^0.16.2",
|
||||||
"mini-toastr": "^0.3.10",
|
"mini-toastr": "^0.6.5",
|
||||||
"nuxt": "latest",
|
"nuxt": "latest",
|
||||||
"vue-notifications": "^0.7.0"
|
"vue-notifications": "^0.8.0"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "nuxt",
|
"dev": "nuxt",
|
||||||
|
@ -10,7 +10,8 @@ import axios from 'axios'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
asyncData () {
|
asyncData () {
|
||||||
return axios.get('https://jsonplaceholder.typicode.com/photos/4').then(res => res.data)
|
const nb = Math.max(1, Math.round(Math.random() * 10))
|
||||||
|
return axios.get(`https://jsonplaceholder.typicode.com/photos/${nb}`).then(res => res.data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue
Block a user