mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 13:28:11 +00:00
Naprawiono odnośnik do pociągu na liście rozkładów scenerii
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, ComputedRef, defineComponent, provide, reactive, Ref, ref } from 'vue';
|
||||
import { computed, ComputedRef, defineComponent, provide, reactive, Ref, ref, watch } from 'vue';
|
||||
|
||||
import { DataStatus } from '@/scripts/enums/DataStatus';
|
||||
import Train from '@/scripts/interfaces/Train';
|
||||
@@ -80,7 +80,6 @@ export default defineComponent({
|
||||
data: () => ({
|
||||
statsIcon: require('@/assets/icon-stats.svg'),
|
||||
trainStatsOpen: false,
|
||||
queryTrain: '',
|
||||
}),
|
||||
|
||||
setup(props) {
|
||||
@@ -94,12 +93,9 @@ export default defineComponent({
|
||||
const searchedDriver = ref('');
|
||||
const searchedTrain = ref('');
|
||||
|
||||
const queryTrain = ref(props.train) as Ref<string>;
|
||||
|
||||
provide('searchedTrain', searchedTrain);
|
||||
provide('searchedDriver', searchedDriver);
|
||||
provide('sorterActive', sorterActive);
|
||||
provide('queryTrain', queryTrain);
|
||||
|
||||
const computedTrains: ComputedRef<Train[]> = computed(() => {
|
||||
if (timetableDataStatus.value != DataStatus.Loaded) return [];
|
||||
@@ -120,6 +116,20 @@ export default defineComponent({
|
||||
chosenTrainCategories,
|
||||
};
|
||||
},
|
||||
|
||||
mounted() {
|
||||
if (this.train) {
|
||||
this.searchedTrain = this.train;
|
||||
this.searchedDriver = '';
|
||||
}
|
||||
},
|
||||
|
||||
activated() {
|
||||
if (this.train) {
|
||||
this.searchedTrain = this.train;
|
||||
this.searchedDriver = '';
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user