From 17b65dedb099a6b79a5edeff60872aac2065ba33 Mon Sep 17 00:00:00 2001 From: ManjaroOne666 Date: Mon, 4 Feb 2019 11:47:25 +0000 Subject: [PATCH] data moved into asyncData() method --- pages/about.vue | 8 +++++++- pages/index.vue | 39 +++++++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/pages/about.vue b/pages/about.vue index 568e3da..15cacc9 100644 --- a/pages/about.vue +++ b/pages/about.vue @@ -25,7 +25,7 @@
@@ -51,6 +51,12 @@ export default { } }, + asyncData () { + return new Promise ((resolve, reject) => { + resolve({ imageUrl: "https://via.placeholder.com/1920x1080" }) + }) + }, + } diff --git a/pages/index.vue b/pages/index.vue index 86d088c..9c020b2 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -38,23 +38,7 @@ export default { return { showHeading: false, 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, - 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: { setNextIndex () { this.currentImageIndex =