[Vuejs]-Vuetify datatable v-select laravel

0👍

This is working:

 <v-select
        :items="mesiace"
        v-model="mesiac"
        item-text="text"
        item-value="value"
        hide-details
        height="20"
        @change="sortValue"
        filter
      ></v-select>

added v-model

mesiac: null,

and

methods:
sortValue() {
  const sortBy =
    this.options.sortBy.length == 0 ? "date" : this.options.sortBy[0];
  const orderBy =
    this.options.sortDesc.length > 0 && this.options.sortDesc[0]
      ? "asc"
      : "desc";
  axios
    .get(`https://api/api/v1/o2attendances/all`, {
      params: {
        sort_by: sortBy,
        order_by: orderBy,
        month: this.mesiac
      }
    })
    .then(response => {
      this.o2attendances = response.data.o2attendances;
    });
},

Leave a comment