<script setup>
import multiselect from '@suadelabs/vue3-multiselect';
import { onMounted, ref } from 'vue';
import { defineEmits } from 'vue'


const props = defineProps(['modelValue', 'options', 'trackby', 'selectby', 'label', 'value', 'allowEmpty']);
defineEmits(['update:modelValue', 'changeValue']);

const input = ref(null);
const value = ref(props.modelValue);

console.log('props=',value.value);

</script>
  
<!-- Vue component -->
<template>

  
  <multiselect :value="modelValue" v-model="value" @select='$emit("changeValue", $event)'  :track-by="trackby" :label="label" placeholder="Vyber jednu" :options="options" :clear-on-select="false" :searchable="true"  ref="input">
    
  </multiselect>

</template>