Fix reaktywności SRJP

This commit is contained in:
2022-07-19 23:32:16 +02:00
parent a392991030
commit 4e0fb5dc01
11 changed files with 1058 additions and 7502 deletions
+30
View File
@@ -0,0 +1,30 @@
import { defineComponent } from 'vue';
import { useStore } from '../store/store';
export default defineComponent({
setup() {
return {
store: useStore(),
};
},
mounted() {
console.log('Mixin mounted');
},
computed: {
chosenTrain() {
return this.store.trainList.find((train) => train.trainId == this.store.chosenModalTrainId);
},
},
methods: {
selectModalTrain(trainId: string) {
this.store.chosenModalTrainId = trainId;
},
closeModal() {
this.store.chosenModalTrainId = undefined;
},
},
});