mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
32 lines
689 B
TypeScript
32 lines
689 B
TypeScript
import { defineComponent } from 'vue';
|
|
import { useStore } from '../store/store';
|
|
|
|
export default defineComponent({
|
|
data() {
|
|
return {
|
|
store: useStore(),
|
|
};
|
|
},
|
|
|
|
computed: {
|
|
chosenTrain() {
|
|
return this.store.trainList.find((train) => train.trainId == this.store.chosenModalTrainId);
|
|
},
|
|
},
|
|
|
|
methods: {
|
|
selectModalTrain(trainId: string) {
|
|
this.store.chosenModalTrainId = trainId;
|
|
document.body.classList.add('no-scroll');
|
|
},
|
|
|
|
closeModal() {
|
|
this.store.chosenModalTrainId = undefined;
|
|
|
|
setTimeout(() => {
|
|
document.body.classList.remove('no-scroll');
|
|
}, 150);
|
|
},
|
|
},
|
|
});
|