From 69772460b88f5f5c86dca11e8cc86475b8b83298 Mon Sep 17 00:00:00 2001 From: Spythere Date: Tue, 1 Nov 2022 18:27:27 +0100 Subject: [PATCH] =?UTF-8?q?Poprawka=20w=20dzia=C5=82aniu=20sortowania=20wy?= =?UTF-8?q?szukiwarki=20scenerii?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StationsView/StationFilterCard.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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);