index.js
2.1 KB
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '@/views/HomeView.vue'
Vue.use(VueRouter)
// 获取原型对象push函数
const originalPush = VueRouter.prototype.push
// 获取原型对象replace函数
const originalReplace = VueRouter.prototype.replace
// 修改原型对象中的push函数
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
// 修改原型对象中的replace函数
VueRouter.prototype.replace = function replace(location) {
return originalReplace.call(this, location).catch(err => err)
}
const routes = [
{
path: '/',
name: 'HomeView',
meta: {
title: '首页',
icon: 'home-o',
isTabBarMenu: true,
keepAlive: true,
showNavBar: true
},
component: HomeView
},
{
path: '/caricature',
name: 'CaricatureView',
meta: {
title: '漫画',
icon: 'home-o',
isTabBarMenu: true,
keepAlive: true,
showNavBar: true
},
component: () => import('../views/CaricatureView.vue')
},
{
path: '/active',
name: 'ActiveView',
meta: {
title: '活动',
icon: 'home-o',
isTabBarMenu: true,
keepAlive: true,
showNavBar: true
},
component: () => import('../views/ActiveView.vue')
},
{
path: '/live',
name: 'LiveView',
meta: {
title: '直播',
icon: 'home-o',
isTabBarMenu: true,
keepAlive: true,
showNavBar: true
},
component: () => import('../views/LiveView.vue')
},
{
path: '/mine',
name: 'MineView',
meta: {
title: '我的',
icon: 'home-o',
isTabBarMenu: true,
keepAlive: true,
showNavBar: true
},
component: () => import('../views/MineView.vue')
},
{
path: '/detail',
name: 'DetailView',
meta: {
title: '详情',
isTabBarMenu: false,
showNavBar: true
},
component: () => import('../views/DetailView.vue')
}
]
const router = new VueRouter({
// mode: 'history',
// base: process.env.BASE_URL,
routes
})
export default router