kanban > virtual sample step : fix getFrontView function when number of x front views is odd
This commit is contained in:
parent
f373e4e89d
commit
2d37915b50
2 changed files with 13 additions and 3 deletions
|
|
@ -11,8 +11,16 @@
|
|||
:data-count="images.length"
|
||||
:data-plus="images.length > 3 ? images.length - 3 : undefined"
|
||||
>
|
||||
<template v-for="image in images.slice(0, 3)" :key="image.uuid">
|
||||
<img v-if="image.url" :src="image.url" :alt="image.alt" loading="lazy">
|
||||
<template
|
||||
v-for="(image, index) in images.slice(0, 3)"
|
||||
:key="'image-' + index"
|
||||
>
|
||||
<img
|
||||
v-if="image.url"
|
||||
:src="image.url"
|
||||
:alt="image.alt"
|
||||
loading="lazy"
|
||||
/>
|
||||
<div v-else class="card__images" data-icon="document"></div>
|
||||
</template>
|
||||
</figure>
|
||||
|
|
@ -43,6 +51,8 @@ const { images, step, uri } = defineProps({
|
|||
uri: String,
|
||||
});
|
||||
|
||||
console.log(images);
|
||||
|
||||
const { isDesignToLightStep } = useDesignToLightStore();
|
||||
|
||||
const commentsCount = computed(() => {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ function getFrontView(track) {
|
|||
const xMax = parseInt(
|
||||
track.files[track.files.length - 1].name.split('_')[1].split('.')[0]
|
||||
);
|
||||
const xFrontView = (xMax + 1) / 2;
|
||||
const xFrontView = Math.round((xMax + 1) / 2);
|
||||
const extension = track.files[0].name.split('.')[1];
|
||||
const frontViewName = '0_' + xFrontView + '.' + extension;
|
||||
const frontView = track.files.find((file) => file.name === frontViewName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue