mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
Poprawka w działaniu sortowania wyszukiwarki scenerii
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<datalist id="sceneries">
|
<datalist id="sceneries">
|
||||||
<option v-for="scenery in store.stationList" :value="scenery.name"></option>
|
<option v-for="scenery in sortedStationList" :value="scenery.name"></option>
|
||||||
</datalist>
|
</datalist>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
@@ -150,6 +150,14 @@ export default defineComponent({
|
|||||||
this.currentRegion = this.store.region;
|
this.currentRegion = this.store.region;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
computed: {
|
||||||
|
sortedStationList() {
|
||||||
|
return this.store.stationList
|
||||||
|
.filter((s) => s.name.toLocaleLowerCase().includes(this.chosenSearchScenery.toLocaleLowerCase()))
|
||||||
|
.sort((s1, s2) => (s1.name > s2.name ? 1 : -1));
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
watch: {
|
watch: {
|
||||||
chosenSearchScenery(value: string) {
|
chosenSearchScenery(value: string) {
|
||||||
const chosenStation = this.store.stationList.find(({ name }) => name == value);
|
const chosenStation = this.store.stationList.find(({ name }) => name == value);
|
||||||
|
|||||||
Reference in New Issue
Block a user