diff --git a/src/App.vue b/src/App.vue index a2cee06..3fea1da 100644 --- a/src/App.vue +++ b/src/App.vue @@ -30,13 +30,13 @@ export default Vue.extend({ watch: { '$route.params.tab': { handler () { - if (this.$route.params.tab === 'settings') { + if (this.$route.path === '/settings') { return } const tabNumber = Number(this.$route.params.tab) const isValidTabNumber = tabNumber >= 1 && tabNumber <= this.$store.state.tabs.length if (!isValidTabNumber) { - this.$router.push(`/1/${this.$store.state.tabs[0].path}`) + this.$router.push(`/timetables/1/${this.$store.state.tabs[0].path}`) } }, deep: true, @@ -59,7 +59,7 @@ export default Vue.extend({ }, '$store.state.tabs': { handler () { - if (this.$route.params.tab === 'settings') { + if (this.$route.path === '/settings') { return } const tabNumber = Number(this.$route.params.tab) @@ -67,7 +67,7 @@ export default Vue.extend({ if (!isValidTabNumber) { const newTabNumber = Math.min(this.$store.state.tabs.length, Math.max(1, Number(this.$route.params.tab))) const { line, stop } = this.$store.state.tabs[newTabNumber - 1] - this.$router.push(`/${newTabNumber}${line ? `/${line}` : ''}${stop ? `/${stop}` : ''}`) + this.$router.push(`/timetables/${newTabNumber}${line ? `/${line}` : ''}${stop ? `/${stop}` : ''}`) } }, deep: true, diff --git a/src/components/AppHeader.vue b/src/components/AppHeader.vue index 86b4e33..30ea657 100644 --- a/src/components/AppHeader.vue +++ b/src/components/AppHeader.vue @@ -3,13 +3,13 @@
-
diff --git a/src/components/AppNav.vue b/src/components/AppNav.vue index 572732b..326d99c 100644 --- a/src/components/AppNav.vue +++ b/src/components/AppNav.vue @@ -8,7 +8,7 @@ class="tab" :class="{ 'tab-active': tabIndex() === i }" > - + @@ -36,7 +36,7 @@ class="tab" :class="{ 'tab-active': tabIndex() === i }" > - + @@ -76,18 +76,18 @@ export default Vue.extend({ }, addTab () { this.$store.commit('addTab') - this.$router.push(`/${this.$store.state.tabs.length}`) + this.$router.push(`/timetables/${this.$store.state.tabs.length}`) }, closeTab (tabIndex: number) { const currentTabIndex = Number(this.$route.params.tab) - 1 if (currentTabIndex > tabIndex) { const { line, stop } = this.$store.state.tabs[currentTabIndex] this.$store.commit('closeTab', { tabIndex }) - this.$router.push(`/${currentTabIndex}${line ? `/${line}` : ''}${stop ? `/${stop}` : ''}`) + this.$router.push(`/timetables/${currentTabIndex}${line ? `/${line}` : ''}${stop ? `/${stop}` : ''}`) } else { this.$store.commit('closeTab', { tabIndex }) const { line, stop } = this.$store.state.tabs[currentTabIndex] - this.$router.push(`/${currentTabIndex + 1}${line ? `/${line}` : ''}${stop ? `/${stop}` : ''}`) + this.$router.push(`/timetables/${currentTabIndex + 1}${line ? `/${line}` : ''}${stop ? `/${stop}` : ''}`) } }, }, diff --git a/src/components/AppPageView.vue b/src/components/AppPageView.vue index 3712c1a..a7a596f 100644 --- a/src/components/AppPageView.vue +++ b/src/components/AppPageView.vue @@ -1,8 +1,8 @@