0

I want the result in this field, which is displayed as suggested, to be from descending to ascending.

    <!-- city -->
    <div class="col-md-6">
      <label class="form-label fw-bold w-100">{{ $t('post code') }}
        <v-select v-model="form.postCode" :disabled="!form.country" label="name" :filterable="false"
                  class="my-1"
                  :options="postCodes"
                  :class="{ 'is-invalid': form.errors.has('postCode') }"
                  @search="onSearch"
        >
          <template slot="no-options">
            Please enter 2 or more characters
          </template>
          <template #search="{attributes, events}">
            <input
              class="vs__search"
              :required="!form.postCode"
              v-bind="attributes"
              v-on="events"
            >
          </template>
        </v-select>
      </label>
      <has-error :form="form" field="postCode" />
    </div>
  </div>

How can i ?

Alex
  • 1

1 Answers1

-1

You can create computed property and array sort inside of that computed property and return the result from that property. You can also check this post for more information: array sort

More information about computed properties: https://v2.vuejs.org/v2/guide/computed.html

gguney
  • 2,512
  • 1
  • 12
  • 26