Fix path and add random image

This commit is contained in:
Sébastien Chopin 2017-07-08 20:26:11 +02:00
parent 592f8cc733
commit ebb67243c8
3 changed files with 6 additions and 5 deletions

View File

@ -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 }
] ]
} }

View File

@ -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",

View File

@ -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>