-const routes: RouteRecordRaw[] = [
- {
- path: '/',
- name: 'charging-stations',
- component: ChargingStationsView,
- },
-];
-
-const router = createRouter({
- history: createWebHistory(process.env.BASE_URL),
- routes,
-});
-
-export default router;
+export const router = createRouter({
+ history: createWebHistory(),
+ routes: [
+ {
+ path: '/',
+ name: 'charging-stations',
+ components: {
+ default: ChargingStationsView
+ }
+ },
+ {
+ path: '/add-charging-stations',
+ name: 'add-charging-stations',
+ components: {
+ default: ChargingStationsView,
+ action: AddChargingStations
+ }
+ },
+ {
+ path: '/start-transaction/:hashId/:chargingStationId/:connectorId',
+ name: 'start-transaction',
+ components: {
+ default: ChargingStationsView,
+ action: StartTransaction
+ },
+ props: { default: false, action: true }
+ }
+ ]
+})