chore: selecting station checkpoint from url

This commit is contained in:
2024-08-20 14:31:52 +02:00
parent 4969a433cc
commit 481d43b6d8
3 changed files with 50 additions and 24 deletions
+13 -1
View File
@@ -3,10 +3,16 @@
class="stop-label"
:data-minor="stop.isSBL || (stop.nameRaw.endsWith(', po') && !stop.duration)"
>
<router-link :to="`/scenery?station=${stop.sceneryName}`" @click="closeModal">
<router-link
v-if="/(, podg|<strong>)/.test(stop.nameHtml)"
:to="sceneryHref"
@click="closeModal"
>
<span class="name" v-html="stop.nameHtml"></span>
</router-link>
<span v-else class="name" v-html="stop.nameHtml"></span>
<span
v-if="stop.position != 'begin'"
class="date arrival"
@@ -79,6 +85,12 @@ export default defineComponent({
type: Object as PropType<TrainScheduleStop>,
required: true
}
},
computed: {
sceneryHref() {
return `/scenery?station=${this.stop.sceneryName}&checkpoint=${this.stop.nameRaw}`;
}
}
});
</script>