This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathrouter.ts
80 lines (79 loc) · 2.16 KB
/
router.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router'
import { RouteName } from './types'
export default createRouter({
history: import.meta.env.VITE_ROUTER_HASH_MODE === 'TRUE' ? createWebHashHistory() : createWebHistory(),
routes: [
{
path: '/swap',
component: () => import('./pages/trade/index.vue'),
children: [
{
name: RouteName.Swap,
path: '',
component: () => import('./pages/trade/swap.vue'),
},
{
name: RouteName.Liquidity,
path: '/liquidity',
component: () => import('./pages/trade/liquidity/index.vue'),
},
{
name: RouteName.LiquidityAdd,
path: '/liquidity/add/:tokenA?/:tokenB?',
component: () => import('./pages/trade/liquidity/add.vue'),
},
{
name: RouteName.LiquidityRemove,
path: '/liquidity/remove',
component: () => import('./pages/trade/liquidity/remove.vue'),
},
],
},
{
path: '/farms',
component: () => import('./pages/earn/index.vue'),
children: [
{
name: RouteName.Farms,
path: '',
component: () => import('./pages/earn/farms.vue'),
},
{
name: RouteName.Pools,
path: '/pools',
component: () => import('./pages/earn/pools.vue'),
},
],
},
{
path: '/assets',
component: () => import('./pages/assets/index.vue'),
children: [
{
name: RouteName.Assets,
path: '',
component: () => import('./pages/assets/assets.vue'),
},
{
name: RouteName.Transactions,
path: '/transactions',
component: () => import('./pages/assets/transactions.vue'),
},
],
},
{
name: RouteName.Voting,
path: '/voting',
component: () => import('./pages/voting/index.vue'),
},
{
name: RouteName.VotingProposal,
path: '/voting/:id',
component: () => import('./pages/voting/[id].vue'),
},
{
path: '/:catchAll(.*)*',
redirect: { name: RouteName.Swap },
},
],
})