Dodano możliwość wyboru realnych zestawień

This commit is contained in:
2021-12-07 16:02:55 +01:00
parent 7b6a316466
commit ee5b61cb19
10 changed files with 331 additions and 2 deletions
+21 -1
View File
@@ -1,4 +1,6 @@
<template>
<ready-stock-list />
<section class="inputs">
<div class="input inputs_loco">
<div class="input_container">
@@ -40,6 +42,10 @@
</button> -->
</div>
<div>
<button class="btn" @click="setReadyStockList(true)"><b>REALNE ZESTAWIENIA</b></button>
</div>
<div class="input_checkbox">
<button @click="onShowSupporterChange" :class="{ checked: this.store.showSupporter }" data-ignore-outside="1">
Pokaż tylko pojazdy dla supporterów
@@ -117,14 +123,24 @@
<script lang="ts">
import { ICarWagon, ILocomotive, IStore } from '@/types';
import { defineComponent, inject } from 'vue';
import { defineComponent, inject, provide, ref } from 'vue';
import ReadyStockList from '@/components/ReadyStockList.vue';
export default defineComponent({
components: {
ReadyStockList,
},
setup() {
const store = inject('Store') as IStore;
const isReadyStockListOpen = ref(false);
provide('isReadyStockListOpen', isReadyStockListOpen);
return {
store,
isReadyStockListOpen,
locoDataList: inject('locoDataList') as ILocomotive[],
carDataList: inject('carDataList') as ICarWagon[],
isTrainPassenger: inject('isTrainPassenger') as boolean,
@@ -224,6 +240,10 @@ export default defineComponent({
this.store.swapVehicles = true;
},
setReadyStockList(bool = false) {
this.isReadyStockListOpen = bool;
},
onShowSupporterChange() {
this.store.showSupporter = !this.store.showSupporter;