import { createRouter, createWebHashHistory } from 'vue-router' const routes = [ { path: '/', redirect: '/home' }, { name: 'login', path: '/login', component: () => import('../views/login'), meta: { title: '登录', }, }, { name: 'home', path: '/home', component: () => import('../views/home'), meta: { title: '首页', }, }, { name: 'userInfo', path: '/userInfo', component: () => import('../views/userInfo'), meta: { title: '账号中心', }, }, { name: 'repairOnline', path: '/repairOnline', component: () => import('../views/repairOnline'), meta: { title: '线上报修', }, }, { name: 'reviewCheck', path: '/reviewCheck', component: () => import('../views/reviewCheck'), meta: { title: '巡检记录', }, }, { name: 'reduceRecord', path: '/reduceRecord', component: () => import('../views/reduceRecord'), meta: { title: '扣缴记录', }, }, { name: 'deviceAlarm', path: '/deviceAlarm', component: () => import('../views/deviceAlarm'), meta: { title: '设备异常', }, }, { name: 'lackFee', path: '/lackFee', component: () => import('../views/lackFee'), meta: { title: '欠费待收', }, }, { name: 'remoteControl', path: '/remoteControl', component: () => import('../views/remoteControl'), meta: { title: '远程管控', }, }, { name: 'repairList', path: '/repairList', component: () => import('../views/repairList'), meta: { title: '工单待办', }, }, { name: 'repairDetail', path: '/repairDetail', component: () => import('../views/repairDetail'), meta: { title: '工单详情', }, }, { name: 'rentBill', path: '/rentBill', component: () => import('../views/rentBill'), meta: { title: '租户账单', }, } , { name: 'rentBillDetail', path: '/rentBillDetail', component: () => import('../views/rentBillDetail'), meta: { title: '账单明细', }, } , { name: 'checkClock', path: '/checkClock', component: () => import('../views/checkClock'), meta: { title: '巡检打卡', }, } // { // path: '/alllist', // name: '全部人员列表', // component: () => import(/* webpackChunkName: "about" */ '../views/alllist.vue') // }, ] const router = createRouter({ history: createWebHashHistory(), routes }) // 全局前置守卫,设置页面标题 router.beforeEach((to, from, next) => { // const title = to.meta && to.meta.title; // if (title) { // document.title = title; // } document.title = '双碳感知资产运营管理平台'; next(); //必须写 }); export default router