'descending to ascending in input search on Vuejs
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 ?
Solution 1:[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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | gguney |
