index.js
512 Bytes
import { createRouter, createWebHistory } from 'vue-router'
const routes = [
{
path: '/',
redirect: '/smart-light'
},
{
path: '/smart-light',
name: 'SmartLight',
component: () => import('../views/SmartLight.vue'),
meta: { title: '动态监控' }
},
{
path: '/energy',
name: 'Energy',
component: () => import('../views/Energy.vue'),
meta: { title: '能耗' }
}
]
const router = createRouter({
history: createWebHistory(),
routes
})
export default router