mirror of
https://github.com/Spythere/stacjownik.git
synced 2026-05-03 05:18:11 +00:00
feature: nawigacja URL w widoku scenerii
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
:key="i"
|
||||
class="btn btn--option"
|
||||
@click="setViewMode(viewMode.component)"
|
||||
:data-checked="currentViewCompontent == viewMode.component"
|
||||
:data-checked="currentMode == viewMode.component"
|
||||
>
|
||||
{{ $t(viewMode.id) }}
|
||||
</button>
|
||||
@@ -35,10 +35,10 @@
|
||||
|
||||
<keep-alive>
|
||||
<component
|
||||
:is="currentViewCompontent"
|
||||
:is="currentMode"
|
||||
:onlineScenery="onlineSceneryInfo"
|
||||
:station="stationInfo"
|
||||
:key="currentViewCompontent"
|
||||
:key="currentMode"
|
||||
></component>
|
||||
</keep-alive>
|
||||
</div>
|
||||
@@ -113,9 +113,9 @@ export default defineComponent({
|
||||
onlineFrom: -1
|
||||
}),
|
||||
|
||||
activated() {
|
||||
this.loadSelectedCheckpoint();
|
||||
},
|
||||
// activated() {
|
||||
// this.loadSelectedCheckpoint();
|
||||
// },
|
||||
|
||||
setup() {
|
||||
const route = useRoute();
|
||||
@@ -128,6 +128,10 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
computed: {
|
||||
currentMode() {
|
||||
return this.$route.query.view ?? 'SceneryTimetable';
|
||||
},
|
||||
|
||||
stationInfo() {
|
||||
return this.store.stationList.find(
|
||||
(station) => station.name === this.station?.toString().replace(/_/g, ' ')
|
||||
@@ -145,7 +149,13 @@ export default defineComponent({
|
||||
|
||||
methods: {
|
||||
setViewMode(componentName: string) {
|
||||
this.currentViewCompontent = componentName;
|
||||
this.$router.push({
|
||||
path: this.$route.path,
|
||||
query: {
|
||||
...this.$route.query,
|
||||
view: componentName
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
loadSelectedCheckpoint() {
|
||||
|
||||
Reference in New Issue
Block a user