const index = () => import('@/views/index/index.vue')
// const index2 = () => import('@/views/index/index.vue')
const cases = () => import('@/views/cases/index.vue')
const cases_Read = () => import('@/views/cases/read.vue')
const services = () => import('@/views/services/index.vue')
const services_Read = () => import('@/views/services/read.vue')
const news = () => import('@/views/news/index.vue')
const news_Read = () => import('@/views/news/read.vue')
const about = () => import('@/views/about/index.vue')
import { createRouter, createMemoryHistory, createWebHistory } from 'vue-router'
const routes = [
    {
        path: "/",
        name: "首页",
        component: index,
        meta: {
            title: "首页",
            keepAlive: false
        }
    },
    {
        path: "/cases",
        name: "客户案例",
        component: cases,
        meta: {
            title: "客户案例",
            keepAlive: false
        }
    },
    {
        path: "/cases_Read",
        name: "案例详情页",
        component: cases_Read,
        meta: {
            title: "案例详情页",
            keepAlive: false
        }
    },

    
    {
        path: "/services",
        name: "产品服务",
        component: services,
        meta: {
            title: "产品服务",
            keepAlive: false
        }
    },
    {
        path: "/services_Read",
        name: "产品详情页",
        component: services_Read,
        meta: {
            title: "产品详情页",
            keepAlive: false
        }
    },

    {
        path: "/news",
        name: "新闻动态",
        component: news,
        meta: {
            title: "新闻动态",
            keepAlive: false
        }
    },
    {
        path: "/news_Read",
        name: "新闻详情",
        component: news_Read,
        meta: {
            title: "新闻详情",
            keepAlive: false
        }
    },
    {
        path: "/about",
        name: "关于永天",
        component: about,
        meta: {
            title: "关于永天",
            keepAlive: false
        }
    }

]

// const router = createRouter({
//     history:  import.meta.env.SSR ? createMemoryHistory() : createWebHistory(),
//     routes
// })

// export default router
export function createSSRRouter(){
    return createRouter({
        history:  import.meta.env.SSR ? createMemoryHistory() : createWebHistory(),
        routes
    })
}