Skip to content

Commit

Permalink
Merge pull request #61 from wangchristine/feature/image
Browse files Browse the repository at this point in the history
fix images order
  • Loading branch information
wangchristine authored Nov 27, 2024
2 parents cf04c06 + b1a7b71 commit c5515cb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/views/ImageEditorView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const uploadImage = (event) => {
img.src = URL.createObjectURL(imagesOrigin.value.item(i));
img.onload = () => {
images.value.push(img);
images.value[i] = img;
resolve();
};
img.onerror = () => {
Expand Down Expand Up @@ -458,8 +458,8 @@ onUnmounted(() => {
<div class="multi-preview-block" v-if="images.length > 1">
<p>Images {{ imageSelected + 1 }} of {{ images.length }}</p>
<div class="images">
<a v-for="(image, key) in images" :key="image.src" @click="selectImage(key)">
<img :src="image.src" :class="{ selected: key === imageSelected }">
<a v-for="(image, key) in images" :key="image?.src" @click="selectImage(key)">
<img :src="image?.src" :class="{ selected: key === imageSelected }">
</a>
</div>
</div>
Expand All @@ -485,7 +485,7 @@ onUnmounted(() => {
</p>
<p>
Origin resolution:
<span v-if="images.length !== 0">{{ images[imageSelected].width }} * {{ images[imageSelected].height }}</span>
<span v-if="images.length !== 0">{{ images[imageSelected]?.width }} * {{ images[imageSelected]?.height }}</span>
</p>
</div>
<div class="draw-tool">
Expand Down

0 comments on commit c5515cb

Please sign in to comment.