eslint & prettier update; api fetching from static server

This commit is contained in:
2024-03-27 16:10:53 +01:00
parent f9276f6c71
commit 337425d21c
37 changed files with 636 additions and 565 deletions
+12 -14
View File
@@ -28,18 +28,18 @@
</template>
<script setup lang="ts">
import { Ref, computed, nextTick, ref, watch } from "vue";
import { useStore } from "../../store";
import { IStock } from "../../types";
import { Ref, computed, nextTick, ref, watch } from 'vue';
import { useStore } from '../../store';
import { IStock } from '../../types';
const store = useStore();
const emit = defineEmits(["listItemClick"]);
const emit = defineEmits(['listItemClick']);
const thumbnailsRef = ref() as Ref<HTMLElement>;
const draggedIndex = ref(-1);
const onListItemClick = (index: number) => {
emit("listItemClick", index);
emit('listItemClick', index);
};
const stockImageError = (e: Event, stock: IStock) => {
@@ -55,12 +55,12 @@ watch(
(thumbnailsRef.value as HTMLElement)
.querySelector(`div:nth-child(${index + 1})`)
?.scrollIntoView({
block: "nearest",
inline: "start",
behavior: "smooth",
block: 'nearest',
inline: 'start',
behavior: 'smooth',
});
});
},
}
);
// Dragging images
@@ -71,9 +71,7 @@ const onDragStart = (vehicleIndex: number) => {
const onDrop = (e: DragEvent, vehicleIndex: number) => {
e.preventDefault();
let targetEl = thumbnailsRef.value.querySelector(
`div:nth-child(${vehicleIndex + 1})`,
);
let targetEl = thumbnailsRef.value.querySelector(`div:nth-child(${vehicleIndex + 1})`);
if (!targetEl && draggedIndex.value != -1) return;
@@ -114,7 +112,7 @@ const allowDrop = (e: DragEvent) => {
-moz-user-select: none;
-webkit-user-select: none;
&[data-selected="true"] {
&[data-selected='true'] {
background-color: rebeccapurple;
}
@@ -123,7 +121,7 @@ const allowDrop = (e: DragEvent) => {
margin: 0 1em;
}
&[data-sponsor="true"] > b {
&[data-sponsor='true'] > b {
color: salmon;
}