Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
FLIPPED-AURORA
gin-vue-admin
提交
bed2db40
G
gin-vue-admin
项目概览
FLIPPED-AURORA
/
gin-vue-admin
大约 1 年 前同步成功
通知
333
Star
18155
Fork
5506
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gin-vue-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bed2db40
编写于
9月 03, 2021
作者:
P
piexlmax
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
切换为vite模式
上级
804cc44f
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
155 addition
and
49 deletion
+155
-49
web/index.html
web/index.html
+15
-0
web/package.json
web/package.json
+46
-42
web/src/router/index.js
web/src/router/index.js
+2
-2
web/src/utils/_import.js
web/src/utils/_import.js
+0
-3
web/src/utils/asyncRouter.js
web/src/utils/asyncRouter.js
+19
-2
web/vite.config.js
web/vite.config.js
+73
-0
未找到文件。
web/index.html
0 → 100644
浏览文件 @
bed2db40
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<link
rel=
"icon"
href=
"favicon.ico"
>
<title></title>
</head>
<body>
<div
id=
"app"
></div>
<script
type=
"module"
src=
"./src/main.js"
></script>
</body>
</html>
web/package.json
浏览文件 @
bed2db40
...
...
@@ -3,9 +3,9 @@
"version"
:
"2.3.5"
,
"private"
:
true
,
"scripts"
:
{
"serve"
:
"node openDocument.js && vue-cli-service serv
e"
,
"build"
:
"vue-cli-servic
e build"
,
"lint"
:
"vue-cli-service lint
"
"serve"
:
"node openDocument.js && vit
e"
,
"build"
:
"vit
e build"
,
"preview"
:
"vite preview
"
},
"dependencies"
:
{
"axios"
:
"^0.19.2"
,
...
...
@@ -33,12 +33,16 @@
"@vue/cli-plugin-router"
:
"~4.5.0"
,
"@vue/cli-plugin-vuex"
:
"~4.5.0"
,
"@vue/cli-service"
:
"~4.5.0"
,
"@vue/compiler-sfc"
:
"^3.0.0
"
,
"@vue/compiler-sfc"
:
"^3.1.5
"
,
"babel-eslint"
:
"^10.1.0"
,
"babel-plugin-import"
:
"^1.13.3"
,
"eslint"
:
"^6.7.2"
,
"eslint-plugin-vue"
:
"^7.0.0"
,
"sass"
:
"^1.26.5"
,
"sass-loader"
:
"^8.0.2"
"sass-loader"
:
"^8.0.2"
,
"vite"
:
"2"
,
"@vitejs/plugin-legacy"
:
"^1.4.4"
,
"vite-plugin-importer"
:
"^0.2.5"
,
"@vitejs/plugin-vue"
:
"latest"
}
}
web/src/router/index.js
浏览文件 @
bed2db40
...
...
@@ -7,12 +7,12 @@ const routes = [{
{
path
:
'
/init
'
,
name
:
'
Init
'
,
component
:
()
=>
import
(
'
@/view/init/index
'
)
component
:
()
=>
import
(
'
@/view/init/index
.vue
'
)
},
{
path
:
'
/login
'
,
name
:
'
Login
'
,
component
:
()
=>
import
(
'
@/view/login/index
'
)
component
:
()
=>
import
(
'
@/view/login/index
.vue
'
)
}
]
...
...
web/src/utils/_import.js
已删除
100644 → 0
浏览文件 @
804cc44f
module
.
exports
=
file
=>
()
=>
{
return
import
(
'
@/
'
+
file
)
}
web/src/utils/asyncRouter.js
浏览文件 @
bed2db40
const
_import
=
require
(
'
./_import
'
)
// 获取组件的方法
const
modules
=
import
.
meta
.
glob
(
'
../../view/**/*.vue
'
)
export
const
asyncRouterHandle
=
(
asyncRouter
)
=>
{
asyncRouter
.
map
(
item
=>
{
if
(
item
.
component
)
{
item
.
component
=
_import
(
item
.
component
)
item
.
component
=
dynamicImport
(
modules
,
item
.
component
)
console
.
log
(
item
.
component
)
}
else
{
delete
item
[
'
component
'
]
}
...
...
@@ -11,3 +13,18 @@ export const asyncRouterHandle = (asyncRouter) => {
}
})
}
function
dynamicImport
(
dynamicViewsModules
,
component
)
{
const
keys
=
Object
.
keys
(
dynamicViewsModules
)
const
matchKeys
=
keys
.
filter
((
key
)
=>
{
let
k
=
key
.
replace
(
'
../../view
'
,
''
)
const
lastIndex
=
k
.
lastIndexOf
(
'
.
'
)
k
=
k
.
substring
(
0
,
lastIndex
)
return
k
===
component
})
const
matchKey
=
matchKeys
[
0
]
return
dynamicViewsModules
[
matchKey
]
}
web/vite.config.js
0 → 100644
浏览文件 @
bed2db40
/* eslint-disable */
import
legacyPlugin
from
'
@vitejs/plugin-legacy
'
;
// import usePluginImport from 'vite-plugin-importer';
import
*
as
path
from
'
path
'
;
import
vuePlugin
from
'
@vitejs/plugin-vue
'
;
// @see https://cn.vitejs.dev/config/
export
default
({
command
,
mode
})
=>
{
let
rollupOptions
=
{};
let
optimizeDeps
=
{};
let
alias
=
{
'
@
'
:
path
.
resolve
(
__dirname
,
'
./src
'
),
'
vue$
'
:
'
vue/dist/vue.runtime.esm-bundler.js
'
,
}
let
proxy
=
{
'
undefined
'
:
{
"
target
"
:
"
undefined:undefined/
"
,
"
changeOrigin
"
:
true
,
"
pathRewrite
"
:
{
"
^undefined
"
:
""
}
},
}
let
define
=
{
'
process.env.NODE_ENV
'
:
'
"development"
'
,
}
let
esbuild
=
{}
return
{
base
:
'
./
'
,
// index.html文件所在位置
root
:
'
./
'
,
// js导入的资源路径,src
resolve
:
{
alias
,
},
define
:
define
,
server
:
{
// 代理
proxy
,
},
build
:
{
target
:
'
es2015
'
,
minify
:
'
terser
'
,
// 是否进行压缩,boolean | 'terser' | 'esbuild',默认使用terser
manifest
:
false
,
// 是否产出maifest.json
sourcemap
:
false
,
// 是否产出soucemap.json
outDir
:
'
build
'
,
// 产出目录
rollupOptions
,
},
esbuild
,
optimizeDeps
,
plugins
:
[
legacyPlugin
({
targets
:
[
'
Android > 39
'
,
'
Chrome >= 60
'
,
'
Safari >= 10.1
'
,
'
iOS >= 10.3
'
,
'
Firefox >= 54
'
,
'
Edge >= 15
'
],
}),
vuePlugin
(),
],
css
:
{
preprocessorOptions
:
{
less
:
{
// 支持内联 JavaScript
javascriptEnabled
:
true
,
}
}
},
}
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录