Fix działania reaktywności linków

This commit is contained in:
2022-12-20 21:31:59 +01:00
parent 7ea558642f
commit e478c510b2
2 changed files with 14 additions and 3 deletions
+10 -2
View File
@@ -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() {
if (this.timetableId) {
this.searchersValues['search-train'] = `#${this.timetableId}`;
@@ -142,8 +152,6 @@ export default defineComponent({
},
mounted() {
console.log('mounted');
if (!this.timetableId) this.searchHistory();
},