Skip to content
Snippets Groups Projects
Commit ff275f39 authored by Håkon Eilertsen Røskaft's avatar Håkon Eilertsen Røskaft
Browse files

Image rezising

parent 2f11e63d
No related branches found
No related tags found
1 merge request!131Datepicker fix
...@@ -4,12 +4,10 @@ ...@@ -4,12 +4,10 @@
</div> </div>
<div v-if="!confirm"> <div v-if="!confirm">
<div> <div>
<div <div v-if="noPicture" class="md:grid md:place-items-center md:h-screen">
v-bind:class="{ <img :src="require('@/assets/default-product.png')" alt="No image found">
'grid grid-flow-row-dense grid-cols-2 md:grid-cols-4 max-h-[600px] w-auto lg:grid-cols-5 place-items-center': </div>
noPicture, <div v-else>
}"
>
<ImageCarousel :images="pictures"></ImageCarousel> <ImageCarousel :images="pictures"></ImageCarousel>
</div> </div>
</div> </div>
...@@ -165,13 +163,7 @@ export default { ...@@ -165,13 +163,7 @@ export default {
let id = this.$router.currentRoute.value.params.id; let id = this.$router.currentRoute.value.params.id;
this.images = await getItemPictures(id); this.images = await getItemPictures(id);
if (this.images.length < 1) { if (this.images.length > 0) {
let noImage = {
src: require("@/assets/default-product.png"),
alt: "No image found",
};
this.pictures.push(noImage);
} else {
this.noPicture = false; this.noPicture = false;
for (let i = 0; i < this.images.length; i++) { for (let i = 0; i < this.images.length; i++) {
let oneImage = { let oneImage = {
...@@ -181,7 +173,7 @@ export default { ...@@ -181,7 +173,7 @@ export default {
}; };
this.pictures.push(oneImage); this.pictures.push(oneImage);
} }
} }
//TODO fixs so each image get a correct alt text. //TODO fixs so each image get a correct alt text.
}, },
async getUser(userId) { async getUser(userId) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment