From 2aa7aa47c0030dd4c4775859773b9b4994755bd8 Mon Sep 17 00:00:00 2001 From: ludchieng Date: Tue, 24 Jan 2023 23:17:20 +0100 Subject: [PATCH] refactor: clean routes --- src/main.ts | 11 ++++---- .../TimetablesHubPage.vue} | 6 ++--- .../TimetablesLinePage.vue} | 6 ++--- src/pages/TimetablesPage.vue | 26 ------------------- .../TimetablesStopPage.vue} | 6 ++--- 5 files changed, 15 insertions(+), 40 deletions(-) rename src/{components/Timetables/TimetablesHome.vue => pages/TimetablesHubPage.vue} (93%) rename src/{components/Timetables/TimetablesLine.vue => pages/TimetablesLinePage.vue} (81%) delete mode 100644 src/pages/TimetablesPage.vue rename src/{components/Timetables/TimetablesStop.vue => pages/TimetablesStopPage.vue} (93%) diff --git a/src/main.ts b/src/main.ts index 1a4ecff..b04af5a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -4,8 +4,10 @@ import Vuex from 'vuex' import VuexPersistence from 'vuex-persist' import './registerServiceWorker' import App from './App.vue' -import TimetablesPage from '@/pages/TimetablesPage.vue' import SettingsPage from '@/pages/SettingsPage.vue' +import TimetablesHubPage from '@/pages/TimetablesHubPage.vue' +import TimetablesLinePage from '@/pages/TimetablesLinePage.vue' +import TimetablesStopPage from '@/pages/TimetablesStopPage.vue' Vue.config.productionTip = false Vue.use(VueRouter) @@ -14,10 +16,9 @@ Vue.use(Vuex) const routes = [ { path: '/', component: App }, { path: '/settings', component: SettingsPage }, - { path: '/timetables/', component: TimetablesPage }, - { path: '/timetables/:tab', component: TimetablesPage }, - { path: '/timetables/:tab/:line', component: TimetablesPage }, - { path: '/timetables/:tab/:line/:stop', component: TimetablesPage }, + { path: '/timetables/:tab', component: TimetablesHubPage }, + { path: '/timetables/:tab/:line', component: TimetablesLinePage }, + { path: '/timetables/:tab/:line/:stop', component: TimetablesStopPage }, ] const router = new VueRouter({ diff --git a/src/components/Timetables/TimetablesHome.vue b/src/pages/TimetablesHubPage.vue similarity index 93% rename from src/components/Timetables/TimetablesHome.vue rename to src/pages/TimetablesHubPage.vue index 63e5d71..25e70ba 100644 --- a/src/components/Timetables/TimetablesHome.vue +++ b/src/pages/TimetablesHubPage.vue @@ -1,5 +1,5 @@