data moved into asyncData() method

This commit is contained in:
ManjaroOne666 2019-02-04 11:47:25 +00:00
parent 8ecf2867d2
commit 17b65dedb0
2 changed files with 30 additions and 17 deletions

View File

@ -25,7 +25,7 @@
</div> </div>
<BackgroundImageLoader slot="background" <BackgroundImageLoader slot="background"
class="background" class="background"
image-url="https://via.placeholder.com/1920x1080" :image-url="imageUrl"
> >
<div slot="overlay" class="background-tint background-overlay"></div> <div slot="overlay" class="background-tint background-overlay"></div>
</BackgroundImageLoader> </BackgroundImageLoader>
@ -51,6 +51,12 @@ export default {
} }
}, },
asyncData () {
return new Promise ((resolve, reject) => {
resolve({ imageUrl: "https://via.placeholder.com/1920x1080" })
})
},
} }
</script> </script>

View File

@ -38,23 +38,7 @@ export default {
return { return {
showHeading: false, showHeading: false,
currentImageIndex: -1, currentImageIndex: -1,
bgImages: [
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider.jpg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider-2.jpeg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider-3.jpeg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/4-edit-3.jpg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/4-edit.jpg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/image-1.png',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider-4.jpeg',
],
currentTaglineIndex: -1, currentTaglineIndex: -1,
taglines: [
'the essence of the image',
'an image of the essential',
'a solitary instance',
'an eternal instance',
'I imagine myself',
],
} }
}, },
@ -86,6 +70,29 @@ export default {
} }
}, },
asyncData({ store }) {
return new Promise ((resolve, reject) => {
resolve({
bgImages: [
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider.jpg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider-2.jpeg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider-3.jpeg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/4-edit-3.jpg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/4-edit.jpg',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/image-1.png',
'https://marcleopold.isnet.uk/wp-content/uploads/2017/07/slider-4.jpeg',
],
taglines: [
'the essence of the image',
'an image of the essential',
'a solitary instance',
'an eternal instance',
'I imagine myself',
],
})
})
},
methods: { methods: {
setNextIndex () { setNextIndex () {
this.currentImageIndex = this.currentImageIndex =