feat(web):重构前端路由和配置管理
- 移除旧版全局变量定义,采用Vue Router管理页面跳转 - 新增配置文件统一管理游戏名称和注册码设置 -优化加载条逻辑,使用onMounted确保DOM元素正确获取 - 添加服务端配置接口,动态加载游戏配置信息 - 升级依赖包,引入vue-router支持单页应用 - 调整项目结构,分离服务器端代码至独立目录 - 配置Vite代理转发API请求到本地开发服务器 - 更新package.json脚本命令,支持前后端联合调试 - 引入pnpm workspace管理模式,提升多包协作效率
This commit is contained in:
22
src/router/index.js
Normal file
22
src/router/index.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import {createRouter, createWebHistory} from 'vue-router'
|
||||
import Index from "../views/index.vue";
|
||||
|
||||
// 示例路由配置
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
component: Index
|
||||
},
|
||||
{
|
||||
path: '/login', name: 'Login',
|
||||
component: () => import('../views/login.vue')
|
||||
}
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes
|
||||
})
|
||||
|
||||
export default router
|
||||
Reference in New Issue
Block a user