Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
cfbd52bb
Unverified
提交
cfbd52bb
authored
5月 28, 2022
作者:
Jim
提交者:
GitHub
5月 28, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: 添加注释 (#1924)
上级
c0edd7b7
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
15 行增加
和
0 行删除
+15
-0
.gitignore
.gitignore
+1
-0
main.ts
src/main.ts
+9
-0
index.ts
src/router/index.ts
+4
-0
index.ts
src/router/routes/index.ts
+1
-0
没有找到文件。
.gitignore
浏览文件 @
cfbd52bb
...
@@ -27,3 +27,4 @@ pnpm-debug.log*
...
@@ -27,3 +27,4 @@ pnpm-debug.log*
*.njsproj
*.njsproj
*.sln
*.sln
*.sw?
*.sw?
/package-lock.json
src/main.ts
浏览文件 @
cfbd52bb
...
@@ -19,28 +19,37 @@ async function bootstrap() {
...
@@ -19,28 +19,37 @@ async function bootstrap() {
const
app
=
createApp
(
App
);
const
app
=
createApp
(
App
);
// Configure store
// Configure store
// 配置 store
setupStore
(
app
);
setupStore
(
app
);
// Initialize internal system configuration
// Initialize internal system configuration
// 初始化内部系统配置
initAppConfigStore
();
initAppConfigStore
();
// Register global components
// Register global components
// 注册全局组件
registerGlobComp
(
app
);
registerGlobComp
(
app
);
// Multilingual configuration
// Multilingual configuration
// 多语言配置
// Asynchronous case: language files may be obtained from the server side
// Asynchronous case: language files may be obtained from the server side
// 异步案例:语言文件可能从服务器端获取
await
setupI18n
(
app
);
await
setupI18n
(
app
);
// Configure routing
// Configure routing
// 配置路由
setupRouter
(
app
);
setupRouter
(
app
);
// router-guard
// router-guard
// 路由守卫
setupRouterGuard
(
router
);
setupRouterGuard
(
router
);
// Register global directive
// Register global directive
// 注册全局指令
setupGlobDirectives
(
app
);
setupGlobDirectives
(
app
);
// Configure global error handling
// Configure global error handling
// 配置全局错误处理
setupErrorHandle
(
app
);
setupErrorHandle
(
app
);
// https://next.router.vuejs.org/api/#isready
// https://next.router.vuejs.org/api/#isready
...
...
src/router/index.ts
浏览文件 @
cfbd52bb
...
@@ -14,9 +14,13 @@ const getRouteNames = (array: any[]) =>
...
@@ -14,9 +14,13 @@ const getRouteNames = (array: any[]) =>
getRouteNames
(
basicRoutes
);
getRouteNames
(
basicRoutes
);
// app router
// app router
// 创建一个可以被 Vue 应用程序使用的路由实例
export
const
router
=
createRouter
({
export
const
router
=
createRouter
({
// 创建一个 hash 历史记录。
history
:
createWebHashHistory
(
import
.
meta
.
env
.
VITE_PUBLIC_PATH
),
history
:
createWebHashHistory
(
import
.
meta
.
env
.
VITE_PUBLIC_PATH
),
// 应该添加到路由的初始路由列表。
routes
:
basicRoutes
as
unknown
as
RouteRecordRaw
[],
routes
:
basicRoutes
as
unknown
as
RouteRecordRaw
[],
// 是否应该禁止尾部斜杠。默认为假
strict
:
true
,
strict
:
true
,
scrollBehavior
:
()
=>
({
left
:
0
,
top
:
0
}),
scrollBehavior
:
()
=>
({
left
:
0
,
top
:
0
}),
});
});
...
...
src/router/routes/index.ts
浏览文件 @
cfbd52bb
...
@@ -37,6 +37,7 @@ export const LoginRoute: AppRouteRecordRaw = {
...
@@ -37,6 +37,7 @@ export const LoginRoute: AppRouteRecordRaw = {
};
};
// Basic routing without permission
// Basic routing without permission
// 未经许可的基本路由
export
const
basicRoutes
=
[
export
const
basicRoutes
=
[
LoginRoute
,
LoginRoute
,
RootRoute
,
RootRoute
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论