Gallery have their url constructed by a ASSET_URL, filename, filevariation and extension.

This commit is contained in:
2019-03-03 22:33:01 +01:00
parent 8b336542e4
commit fef6b511fd

View File

@@ -40,7 +40,8 @@ export default {
return { return {
selected: undefined, selected: undefined,
wide: false, wide: false,
gallery: [] gallery: [],
ASSET_URL: 'https://leifsopplevelser.no/assets'
} }
}, },
created() { created() {
@@ -56,9 +57,15 @@ export default {
.then(images => { .then(images => {
console.log('events', images) console.log('events', images)
images.forEach(image => { images.forEach(image => {
let [filename, filextension] = image.filename.split('.')
console.log('filename:', filename)
console.log('filextension:', filextension)
const url = `${this.ASSET_URL}/${filename}_lg.${filextension}`
this.gallery.push({ this.gallery.push({
type: 'image', type: 'image',
url: 'https://leifsopplevelser.no/images/' + image.filename url
}) })
}) })
}) })