data() {
return {
currentProductDataLoading: true,
currentProductData: [],
media: {
readyURLs: [],
index: null,
},
};
},
methods: {
getProductData() {
this.axios
.get('http://church/wp-json/wp/v2/news?slug=' + this.$route.params.slug)
.then(response => this.currentProductData = response.data);
},
getMediaUrls() {
this.currentProductData[0].acf.photos.forEach(el => {
this.media.readyURLs.push(el.photo);
})
}
},
created() {
this.getProductData();
},
mounted() {
// this.getMediaUrls();
},
computed: {
mediaUrls: function() {
return this.currentProductData[0].acf.photos.forEach(el => {
this.media.readyURLs.push(el.photo);
})
}
},
methods: {
async getProductData() {
await this.axios
.get('http://church/wp-json/wp/v2/news?slug=' + this.$route.params.slug)
.then(response => this.currentProductData = response.data);
},
getMediaUrls() {
this.currentProductData[0].acf.photos.forEach(el => {
this.media.readyURLs.push(el.photo);
})
}
},
created() {
this.getProductData();
},
mounted() {
this.getMediaUrls();
},