mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-04 22:08:12 +00:00
Fix działania reaktywności linków
This commit is contained in:
@@ -21,7 +21,9 @@
|
|||||||
|
|
||||||
<i18n-t keypath="journal.timetable-stats-longest" tag="p">
|
<i18n-t keypath="journal.timetable-stats-longest" tag="p">
|
||||||
<template #id>
|
<template #id>
|
||||||
<b>{{ data.stats.timetableId }}</b>
|
<router-link :to="`/journal/timetables?timetableId=${data.stats.timetableId}`">{{
|
||||||
|
data.stats.timetableId
|
||||||
|
}}</router-link>
|
||||||
</template>
|
</template>
|
||||||
<template #author>
|
<template #author>
|
||||||
<b>{{ data.stats.timetableAuthor }}</b>
|
<b>{{ data.stats.timetableAuthor }}</b>
|
||||||
@@ -53,6 +55,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { reactive, ref } from 'vue';
|
import { reactive, ref } from 'vue';
|
||||||
|
import { onBeforeRouteUpdate, useRouter } from 'vue-router';
|
||||||
import { DataStatus } from '../../scripts/enums/DataStatus';
|
import { DataStatus } from '../../scripts/enums/DataStatus';
|
||||||
import { ITimetablesDailyStats, ITimetablesDailyStatsResponse } from '../../scripts/interfaces/api/StatsAPIData';
|
import { ITimetablesDailyStats, ITimetablesDailyStatsResponse } from '../../scripts/interfaces/api/StatsAPIData';
|
||||||
import { URLs } from '../../scripts/utils/apiURLs';
|
import { URLs } from '../../scripts/utils/apiURLs';
|
||||||
|
|||||||
@@ -134,6 +134,16 @@ export default defineComponent({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Handle route updates for route-links
|
||||||
|
beforeRouteUpdate(to, from) {
|
||||||
|
const timetableId = to.query['timetableId']?.toString();
|
||||||
|
|
||||||
|
if (!timetableId) return;
|
||||||
|
|
||||||
|
this.searchersValues['search-train'] = `#${timetableId}`;
|
||||||
|
this.searchHistory();
|
||||||
|
},
|
||||||
|
|
||||||
activated() {
|
activated() {
|
||||||
if (this.timetableId) {
|
if (this.timetableId) {
|
||||||
this.searchersValues['search-train'] = `#${this.timetableId}`;
|
this.searchersValues['search-train'] = `#${this.timetableId}`;
|
||||||
@@ -142,8 +152,6 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log('mounted');
|
|
||||||
|
|
||||||
if (!this.timetableId) this.searchHistory();
|
if (!this.timetableId) this.searchHistory();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user