Filtrowanie kategoriami RJ (w.i.p.)

This commit is contained in:
2021-12-22 20:19:47 +01:00
parent 604a5ba0d7
commit 7975430c6f
2 changed files with 15 additions and 2 deletions
+9 -1
View File
@@ -82,7 +82,7 @@
import ActionButton from "@/components/Global/ActionButton.vue";
import Train from "@/scripts/interfaces/Train";
import { computed, defineComponent } from "@vue/runtime-core";
import { computed, defineComponent, inject } from "@vue/runtime-core";
export default defineComponent({
components: { ActionButton },
@@ -220,12 +220,16 @@ export default defineComponent({
return [twrList.length, skrList.length];
});
/* Inject list from TrainsView for category filter */
const chosenTrainCategories = inject("chosenTrainCategories") as string[];
return {
speedStats,
timetableStats,
categoryList,
locoList,
specialTrainCount,
chosenTrainCategories
};
},
});
@@ -289,6 +293,10 @@ export default defineComponent({
}
}
/* .category {
cursor: pointer;
} */
.category,
.special {
&-list {
+6 -1
View File
@@ -18,7 +18,7 @@
</template>
<script lang="ts">
import { computed, ComputedRef, defineComponent, ref } from "vue";
import { computed, ComputedRef, defineComponent, provide, reactive, ref } from "vue";
import { DataStatus } from "@/scripts/enums/DataStatus";
import Train from "@/scripts/interfaces/Train";
@@ -125,12 +125,17 @@ export default defineComponent({
);
});
/* Provide list for TrainStats category filter */
const chosenTrainCategories = reactive([] as string[]);
provide('chosenTrainCategories', chosenTrainCategories);
return {
trainList,
computedTrains,
searchedTrain,
searchedDriver,
sorterActive,
chosenTrainCategories
};
},