Init
This commit is contained in:
27
resources/js/Components/MultiSelect.vue
Normal file
27
resources/js/Components/MultiSelect.vue
Normal file
@@ -0,0 +1,27 @@
|
||||
<script setup>
|
||||
import multiselect from '@suadelabs/vue3-multiselect';
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { defineEmits } from 'vue'
|
||||
|
||||
|
||||
defineProps(['modelValue', 'options', 'trackby', 'label']);
|
||||
defineEmits(['update:modelValue']);
|
||||
|
||||
const input = ref(null);
|
||||
|
||||
function update(t) {
|
||||
console.log(t);
|
||||
context.emit("update:modelValue",t);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<!-- Vue component -->
|
||||
<template>
|
||||
|
||||
|
||||
<multiselect :value="modelValue" v-model="value" @select='$emit("update:modelValue", $event)' :track-by="trackby" :label="label" placeholder="Vyber jednu" :options="options" :clear-on-select="false" :searchable="true" ref="input">
|
||||
|
||||
</multiselect>
|
||||
|
||||
</template>
|
||||
Reference in New Issue
Block a user