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"
|
||||
data-icon="chevron-single-down"
|
||||
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>
|
||||
</template>
|
||||
|
||||
|
|
@ -37,11 +50,12 @@ function changeCurrent(item) {
|
|||
emit('update:selectedItems', item);
|
||||
}
|
||||
|
||||
function getFrontViewUrl(track) {
|
||||
if (track.files.length > 1) {
|
||||
return track.files[7].url;
|
||||
function getFrontViewUrl(item) {
|
||||
// if (!item) return;
|
||||
if (item.files.length > 1) {
|
||||
return item.files[7].url;
|
||||
} else {
|
||||
return track.files[0].url;
|
||||
return item.files[0].url;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue