Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
飞鱼0526
gin-vue-admin
提交
bed2db40
G
gin-vue-admin
项目概览
飞鱼0526
/
gin-vue-admin
与 Fork 源项目一致
Fork自
FLIPPED-AURORA / gin-vue-admin
通知
2
Star
0
Fork
0
代码
文件
提交
分支
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
{
{
"name"
:
"gin-vue-admin"
,
"name"
:
"gin-vue-admin"
,
"version"
:
"2.3.5"
,
"version"
:
"2.3.5"
,
"private"
:
true
,
"private"
:
true
,
"scripts"
:
{
"scripts"
:
{
"serve"
:
"node openDocument.js && vue-cli-service serve"
,
"serve"
:
"node openDocument.js && vite"
,
"build"
:
"vue-cli-service build"
,
"build"
:
"vite build"
,
"lint"
:
"vue-cli-service lint"
"preview"
:
"vite preview"
},
},
"dependencies"
:
{
"dependencies"
:
{
"axios"
:
"^0.19.2"
,
"axios"
:
"^0.19.2"
,
"core-js"
:
"^3.6.5"
,
"core-js"
:
"^3.6.5"
,
"echarts"
:
"4.9.0"
,
"echarts"
:
"4.9.0"
,
"element-plus"
:
"^1.1.0-beta.8"
,
"element-plus"
:
"^1.1.0-beta.8"
,
"highlight.js"
:
"^10.6.0"
,
"highlight.js"
:
"^10.6.0"
,
"marked"
:
"^2.0.0"
,
"marked"
:
"^2.0.0"
,
"mitt"
:
"^3.0.0"
,
"mitt"
:
"^3.0.0"
,
"path"
:
"^0.12.7"
,
"path"
:
"^0.12.7"
,
"qs"
:
"^6.8.0"
,
"qs"
:
"^6.8.0"
,
"quill"
:
"^1.3.7"
,
"quill"
:
"^1.3.7"
,
"screenfull"
:
"^5.0.2"
,
"screenfull"
:
"^5.0.2"
,
"script-ext-html-webpack-plugin"
:
"^2.1.4"
,
"script-ext-html-webpack-plugin"
:
"^2.1.4"
,
"spark-md5"
:
"^3.0.1"
,
"spark-md5"
:
"^3.0.1"
,
"vue"
:
"^3.0.0"
,
"vue"
:
"^3.0.0"
,
"vue-particle-line"
:
"^0.1.4"
,
"vue-particle-line"
:
"^0.1.4"
,
"vue-router"
:
"^4.0.0-0"
,
"vue-router"
:
"^4.0.0-0"
,
"vuex"
:
"^4.0.0-0"
,
"vuex"
:
"^4.0.0-0"
,
"vuex-persist"
:
"^2.1.0"
"vuex-persist"
:
"^2.1.0"
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"@vue/cli-plugin-babel"
:
"~4.5.0"
,
"@vue/cli-plugin-babel"
:
"~4.5.0"
,
"@vue/cli-plugin-eslint"
:
"~4.5.0"
,
"@vue/cli-plugin-eslint"
:
"~4.5.0"
,
"@vue/cli-plugin-router"
:
"~4.5.0"
,
"@vue/cli-plugin-router"
:
"~4.5.0"
,
"@vue/cli-plugin-vuex"
:
"~4.5.0"
,
"@vue/cli-plugin-vuex"
:
"~4.5.0"
,
"@vue/cli-service"
:
"~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-eslint"
:
"^10.1.0"
,
"babel-plugin-import"
:
"^1.13.3"
,
"babel-plugin-import"
:
"^1.13.3"
,
"eslint"
:
"^6.7.2"
,
"eslint"
:
"^6.7.2"
,
"eslint-plugin-vue"
:
"^7.0.0"
,
"eslint-plugin-vue"
:
"^7.0.0"
,
"sass"
:
"^1.26.5"
,
"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 = [{
...
@@ -7,12 +7,12 @@ const routes = [{
{
{
path
:
'
/init
'
,
path
:
'
/init
'
,
name
:
'
Init
'
,
name
:
'
Init
'
,
component
:
()
=>
import
(
'
@/view/init/index
'
)
component
:
()
=>
import
(
'
@/view/init/index
.vue
'
)
},
},
{
{
path
:
'
/login
'
,
path
:
'
/login
'
,
name
:
'
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
)
=>
{
export
const
asyncRouterHandle
=
(
asyncRouter
)
=>
{
asyncRouter
.
map
(
item
=>
{
asyncRouter
.
map
(
item
=>
{
if
(
item
.
component
)
{
if
(
item
.
component
)
{
item
.
component
=
_import
(
item
.
component
)
item
.
component
=
dynamicImport
(
modules
,
item
.
component
)
console
.
log
(
item
.
component
)
}
else
{
}
else
{
delete
item
[
'
component
'
]
delete
item
[
'
component
'
]
}
}
...
@@ -11,3 +13,18 @@ export const asyncRouterHandle = (asyncRouter) => {
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录