tracks select : add images to selector
This commit is contained in:
parent
62a716495b
commit
84bfb7b6d5
1 changed files with 19 additions and 5 deletions
|
|
@ -13,7 +13,20 @@
|
||||||
class="font-serif"
|
class="font-serif"
|
||||||
data-icon="chevron-single-down"
|
data-icon="chevron-single-down"
|
||||||
checkmark
|
checkmark
|
||||||
/>
|
>
|
||||||
|
<template #value="slotProps">
|
||||||
|
<div>
|
||||||
|
<img alt="" :src="getFrontViewUrl(current)" />
|
||||||
|
<div>{{ current.title }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #option="slotProps">
|
||||||
|
<div>
|
||||||
|
<img alt="" :src="getFrontViewUrl(slotProps.option)" />
|
||||||
|
<div>{{ slotProps.option.title }}</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -37,11 +50,12 @@ function changeCurrent(item) {
|
||||||
emit('update:selectedItems', item);
|
emit('update:selectedItems', item);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFrontViewUrl(track) {
|
function getFrontViewUrl(item) {
|
||||||
if (track.files.length > 1) {
|
// if (!item) return;
|
||||||
return track.files[7].url;
|
if (item.files.length > 1) {
|
||||||
|
return item.files[7].url;
|
||||||
} else {
|
} else {
|
||||||
return track.files[0].url;
|
return item.files[0].url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue