Initial project

This commit is contained in:
liangping committed 2021-07-21 22:07:38 +08:00
commit ae30de057d
465 files changed
+52080

No files matched your search

+118
View File
@@ -0,0 +1,118 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter)
const router = new VueRouter({
mode: 'history',
base: process.env.BASE_URL,
scrollBehavior() {
return { x: 0, y: 0 }
},
routes: [
{
path: '/',
name: 'home',
component: () => import('@/views/Home.vue'),
meta: {
pageTitle: 'Home',
breadcrumb: [
{
text: 'Home',
active: true,
},
],
},
},
{
path: '/second-page',
name: 'second-page',
component: () => import('@/views/Info.vue'),
meta: {
pageTitle: 'Second Page',
breadcrumb: [
{
text: 'Second Page',
active: true,
},
],
},
},
// chain modules
{
path: '/:chain/info',
name: 'info',
alias: '/:chain',
component: () => import('@/views/Info.vue'),
meta: {
pageTitle: 'Home',
breadcrumb: [
{
text: 'Home',
active: true,
},
],
},
},
{
path: '/:chain/staking',
name: 'staking',
component: () => import('@/views/Staking.vue'),
meta: {
pageTitle: 'Staking',
breadcrumb: [
{
text: 'Staking',
active: true,
},
],
},
},
{
path: '/:chain/gov',
name: 'governance',
component: () => import('@/views/Governance.vue'),
meta: {
pageTitle: 'Governance',
breadcrumb: [
{
text: 'Governance',
active: true,
},
],
},
},
{
path: '/login',
name: 'login',
component: () => import('@/views/Login.vue'),
meta: {
layout: 'full',
},
},
{
path: '/error-404',
name: 'error-404',
component: () => import('@/views/error/Error404.vue'),
meta: {
layout: 'full',
},
},
{
path: '*',
redirect: 'error-404',
},
],
})
// ? For splash screen
// Remove afterEach hook if you are not using splash screen
router.afterEach(() => {
// Remove initial loading
const appLoading = document.getElementById('loading-bg')
if (appLoading) {
appLoading.style.display = 'none'
}
})
export default router