import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
	{path: '/',name: 'index',component: () => import('../views/index/index.vue'),meta: { 	keepAlive: true,}},
	{path: '/provideUnit',name: 'provideUnit',component: () => import('../views/provideUnit/provideUnit.vue'),meta: { 	keepAlive: true,}},
	{path: '/receiveApply',name: 'receiveApply',component: () => import('../views/receiveApply/receiveApply.vue'),meta: { 	keepAlive: true,	isBack: false,}},
	{path: '/informedConsentForm',name: 'informedConsentForm',component: () => import('../views/informedConsentForm/informedConsentForm.vue'),},
	{path: '/applyRecord',name: 'applyRecord',component: () => import('../views/applyRecord/applyRecord.vue'),meta: { 	keepAlive: true,	isBack: false}},
	{path: '/provideDetail',name: 'provideDetail',component: () => import('../views/provideDetail/provideDetail.vue')},
	{path: '/receiveDetail',name: 'receiveDetail',component: () => import('../views/receiveDetail/receiveDetail.vue')},
	{path: '/canvas',name: 'canvas',component: () => import('../views/canvas/canvas.vue')},
	{path: '/questionAnswer',name: 'canvas',component: () => import('../views/questionAnswer/questionAnswer.vue')},

	{path: '/test1',name: 'test1',component: () => import('../views/test/test1.vue')},
]

const router = new VueRouter({
  	routes
})
router.afterEach((to, from) => {
	// 让页面回到顶部
	(document.documentElement.scrollTop = 0) || (document.body.scrollTop = 0);
	// 调用 next()，一定要调用 next 方法，否则钩子就不会被销毁
   	// next();
})

export default router
