Skip to content

Commit

Permalink
Updated the router to match the component page, and to include all of…
Browse files Browse the repository at this point in the history
… the future compat pages
  • Loading branch information
ZestyTS committed Sep 20, 2024
1 parent 2828308 commit fd37cdf
Showing 1 changed file with 53 additions and 3 deletions.
56 changes: 53 additions & 3 deletions src/router/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,63 @@
// Import Vue Router and views
import { createRouter, createWebHashHistory } from 'vue-router';
import Home from '@/views/Home.vue';
import NDSCompat from '@/views/NDSCompat.vue';
import CompatTemplate from '@/components/CompatTemplate.vue';

// Define routes manually (couldn't get dynamic working)
const routes = [
{ path: '/', name: 'Home', component: Home },
{ path: '/ndscompat', name: 'NDSCompat', component: NDSCompat },
{ path: '/:pathMatch(.*)*', redirect: '/' }, // Handle unmatched routes
{
path: '/ndscompat',
name: 'NDSCompat',
component: CompatTemplate,
props: { jsonFileName: 'NDSCompat.json', title: 'NDS' },
},
{
path: '/n64compat',
name: 'N64Compat',
component: CompatTemplate,
props: { jsonFileName: 'N64Compat.json', title: 'N64' },
},
{
path: '/gbacompat',
name: 'GBACompat',
component: CompatTemplate,
props: { jsonFileName: 'GBACompat.json', title: 'GBA' },
},
{
path: '/msxcompat',
name: 'MSXCompat',
component: CompatTemplate,
props: { jsonFileName: 'MSXCompat.json', title: 'MSX' },
},
{
path: '/nescompat',
name: 'NESCompat',
component: CompatTemplate,
props: { jsonFileName: 'NESCompat.json', title: 'NES' },
},
{
path: '/snescompat',
name: 'SNESCompat',
component: CompatTemplate,
props: { jsonFileName: 'SNESCompat.json', title: 'SNES' },
},
{
path: '/tg16compat',
name: 'TG16Compat',
component: CompatTemplate,
props: { jsonFileName: 'TG16Compat.json', title: 'TG16' },
},
{
path: '/wiicompat',
name: 'WiiCompat',
component: CompatTemplate,
props: { jsonFileName: 'WiiCompat.json', title: 'Wii' },
},
{
path: '/:pathMatch(.*)*', // Handle unmatched paths
redirect: '/', // Redirect to the home page
},
];

// Create a new Vue Router instance with manual routing
Expand Down

0 comments on commit fd37cdf

Please sign in to comment.