mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-28 22:32: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: [
|
||||
// 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",
|
||||
"dependencies": {
|
||||
"axios": "^0.15.2",
|
||||
"mini-toastr": "^0.3.10",
|
||||
"axios": "^0.16.2",
|
||||
"mini-toastr": "^0.6.5",
|
||||
"nuxt": "latest",
|
||||
"vue-notifications": "^0.7.0"
|
||||
"vue-notifications": "^0.8.0"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "nuxt",
|
||||
|
@ -10,7 +10,8 @@ import axios from 'axios'
|
||||
|
||||
export default {
|
||||
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>
|
||||
|
Loading…
Reference in New Issue
Block a user