<template>
  <multiselect
    class="combo"
    :class="classes"
    :allow-empty="false"
    :searchable="true"
    :close-on-select="true"
    :show-labels="true"
    label="title"
    track-by="id"
    placeholder="انتخاب پروژه"
    v-model="projectId"
    :options="projects"
    @search-change="searchChanged"
    :hide-selected="false"
    :options-limit="10"
    :max-height="200"
  ></multiselect>
</template>

<script>
export default {
  props: {
    vModel,
    options,
    classes: {
      default: "form-control",
    },
  },
  emits: ["search-change"],
  methods: {
    searchChanged(ev) {
      this.$emit("search-changed", ev);
    },
  },
};
</script>
