diff --git a/src/components/StationsView/StationFilterCard.vue b/src/components/StationsView/StationFilterCard.vue index c0e3e76..65e397f 100644 --- a/src/components/StationsView/StationFilterCard.vue +++ b/src/components/StationsView/StationFilterCard.vue @@ -17,7 +17,7 @@ /> - + @@ -150,6 +150,14 @@ export default defineComponent({ 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: { chosenSearchScenery(value: string) { const chosenStation = this.store.stationList.find(({ name }) => name == value);