import { createRouter, createWebHistory } from 'vue-router'

// 导入页面组件
import Home from '../views/Home.vue'
import About from '../views/About.vue'

// 配置路由
const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
  },
  {
    path: '/about',
    name: 'About',
    component: About,
  },
]

// 创建并导出路由实例
const router = createRouter({
  history: createWebHistory(), // 使用 HTML5 history 模式
  routes, // 路由配置
})

export default router
