mirror of
https://git.hmsn.ink/kospo/svcm/oa.git
synced 2026-03-20 07:53:48 +09:00
5.1 KiB
5.1 KiB
selectSlotOptions, selectSlotValue
| selectSlotOptions | selectSlotValue | |||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Image with search
The <Multiselect /> component can be used with a custom template to show
images for options and selected option. 2 CSS modifiers are available for
images radius: is-curved and is-rounded.
<script setup lang="ts">
const selectSlotValue = ref()
const selectSlotOptions = [
{
value: 'javascript',
name: 'Javascript',
icon: '/images/icons/stacks/js.svg',
},
{
value: 'reactjs',
name: 'ReactJS',
icon: '/images/icons/stacks/reactjs.svg',
},
{
value: 'vuejs',
name: 'VueJS',
icon: '/images/icons/stacks/vuejs.svg',
},
]
</script>
<template>
<VField v-slot="{ id }">
<VControl>
<Multiselect
v-model="selectSlotValue"
:attrs="{ id }"
placeholder="Select a language"
label="name"
:options="selectSlotOptions"
:searchable="true"
track-by="name"
:max-height="145"
>
<template #singlelabel="{ value }">
<div class="multiselect-single-label">
<img
class="select-label-icon"
:src="value.icon"
alt=""
>
{{ value.name }}
</div>
</template>
<template #option="{ option }">
<img
class="select-option-icon"
:src="option.icon"
alt=""
>
{{ option.name }}
</template>
</Multiselect>
</VControl>
</VField>
</template>