Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
剑九 六千里
vue-vben-admin
提交
968f791f
V
vue-vben-admin
项目概览
剑九 六千里
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue-vben-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
968f791f
编写于
10月 20, 2020
作者:
V
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf: optimize the size of the first screen
上级
c2333f5d
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
43 addition
and
26 deletion
+43
-26
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+11
-0
src/components/Table/src/hooks/useProps.ts
src/components/Table/src/hooks/useProps.ts
+0
-9
src/components/Table/src/props.ts
src/components/Table/src/props.ts
+1
-1
src/components/registerGlobComp.ts
src/components/registerGlobComp.ts
+5
-4
src/layouts/default/index.tsx
src/layouts/default/index.tsx
+6
-1
src/layouts/default/setting/index.vue
src/layouts/default/setting/index.vue
+1
-1
src/main.ts
src/main.ts
+3
-4
src/setup/ant-design-vue/index.ts
src/setup/ant-design-vue/index.ts
+2
-2
src/useApp.ts
src/useApp.ts
+10
-1
src/views/sys/login/Login.vue
src/views/sys/login/Login.vue
+3
-1
vite.config.ts
vite.config.ts
+1
-2
未找到文件。
CHANGELOG.zh_CN.md
浏览文件 @
968f791f
# Wip
### ⚡ Performance Improvements
-
优化首屏体积大小
### 🐛 Bug Fixes
-
修复一级菜单折叠显示菜单名问题
-
修复预览命令不打包问题
# 2.0.0-rc.3 (2020-10-19)
### ✨ Features
...
...
src/components/Table/src/hooks/useProps.ts
浏览文件 @
968f791f
/*
* @description:
* @author: wenbin.chen
* @Date: 2020-05-12 13:20:26
* @LastEditors: vben
* @LastEditTime: 2020-10-07 14:52:34
* @email: 190848757@qq.com
*/
import
{
Ref
,
ref
,
watch
,
unref
}
from
'
vue
'
;
import
{
BasicTableProps
}
from
'
../types/table
'
;
...
...
src/components/Table/src/props.ts
浏览文件 @
968f791f
...
...
@@ -133,7 +133,7 @@ export const basicProps = {
},
bordered
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
tru
e
,
default
:
fals
e
,
},
pagination
:
{
type
:
[
Object
,
Boolean
]
as
PropType
<
PaginationProps
|
boolean
>
,
...
...
src/components/registerGlobComp.ts
浏览文件 @
968f791f
import
Icon
from
'
./Icon/index
'
;
import
{
BasicHelp
,
BasicTitle
}
from
'
./Basic
'
;
import
Button
from
'
./Button/index.vue
'
;
import
{
App
}
from
'
vue
'
;
import
{
Button
as
AntButton
}
from
'
ant-design-vue
'
;
import
{
getApp
}
from
'
/@/useApp
'
;
const
compList
=
[
Icon
,
BasicHelp
,
BasicTitle
,
Button
];
export
function
registerGlobComp
(
app
:
App
<
Element
>
)
{
const
compList
=
[
Icon
,
BasicHelp
,
BasicTitle
,
Button
,
AntButton
.
Group
];
export
function
registerGlobComp
()
{
compList
.
forEach
((
comp
:
any
)
=>
{
app
.
component
(
comp
.
name
,
comp
);
getApp
()
.
component
(
comp
.
name
,
comp
);
});
}
src/layouts/default/index.tsx
浏览文件 @
968f791f
...
...
@@ -13,12 +13,17 @@ import { MenuModeEnum, MenuTypeEnum } from '/@/enums/menuEnum';
import
{
useFullContent
}
from
'
/@/hooks/web/useFullContent
'
;
import
LockPage
from
'
/@/views/sys/lock/index.vue
'
;
import
{
registerGlobComp
}
from
'
/@/components/registerGlobComp
'
;
import
'
./index.less
'
;
// import { userStore } from '/@/store/modules/user';
export
default
defineComponent
({
name
:
'
DefaultLayout
'
,
setup
()
{
// ! 在这里才注册全局组件
// ! 可以减少首屏代码体积
// default layout是在登录后才加载的。所以不会打包到首屏去
registerGlobComp
();
// 获取项目配置
const
{
getFullContent
}
=
useFullContent
();
...
...
src/layouts/default/setting/index.vue
浏览文件 @
968f791f
<
template
>
<div
@
click=
"openDrawer"
class=
"setting-button"
>
<SettingOutlined
:spin=
"true"
/>
<SettingOutlined
/>
<SettingDrawer
@
register=
"register"
/>
</div>
</
template
>
...
...
src/main.ts
浏览文件 @
968f791f
...
...
@@ -6,9 +6,9 @@ import { setupAntd } from '/@/setup/ant-design-vue';
import
{
setupErrorHandle
}
from
'
/@/setup/error-handle/index
'
;
import
{
setupDirectives
}
from
'
/@/setup/directives/index
'
;
import
{
registerGlobComp
}
from
'
/@/components/registerGlobComp
'
;
import
{
isDevMode
,
isProdMode
,
isUseMock
}
from
'
/@/utils/env
'
;
import
{
setupProdMockServer
}
from
'
../mock/_createProductionServer
'
;
import
{
setApp
}
from
'
./useApp
'
;
import
App
from
'
./App.vue
'
;
import
'
/@/design/index.less
'
;
...
...
@@ -26,8 +26,6 @@ setupDirectives(app);
setupErrorHandle
(
app
);
registerGlobComp
(
app
);
router
.
isReady
().
then
(()
=>
{
app
.
mount
(
'
#app
'
);
});
...
...
@@ -40,4 +38,5 @@ if (isDevMode()) {
if
(
isProdMode
()
&&
isUseMock
())
{
setupProdMockServer
();
}
export
default
app
;
setApp
(
app
);
src/setup/ant-design-vue/index.ts
浏览文件 @
968f791f
...
...
@@ -2,13 +2,13 @@
import
type
{
App
}
from
'
vue
'
;
import
{
Form
,
Input
,
Button
}
from
'
ant-design-vue
'
;
import
{
Form
,
Input
}
from
'
ant-design-vue
'
;
import
'
ant-design-vue/dist/antd.css
'
;
import
'
./spin
'
;
export
function
setupAntd
(
app
:
App
<
Element
>
)
{
app
.
component
(
Button
.
Group
.
name
,
Button
.
Group
);
// 这两个组件在登录也就用。全局注册
app
.
use
(
Form
);
app
.
use
(
Input
);
}
src/useApp.ts
浏览文件 @
968f791f
import
type
{
ProjectConfig
}
from
'
/@/types/config
'
;
import
type
{
App
}
from
'
vue
'
;
import
{
computed
,
ref
}
from
'
vue
'
;
import
{
ThemeModeEnum
}
from
'
/@/enums/appEnum
'
;
...
...
@@ -17,6 +17,15 @@ import { PageEnum } from '/@/enums/pageEnum';
import
{
useTimeout
}
from
'
/@/hooks/core/useTimeout
'
;
import
{
ExceptionEnum
}
from
'
/@/enums/exceptionEnum
'
;
let
app
:
App
;
export
function
setApp
(
_app
:
App
):
void
{
app
=
_app
;
}
export
function
getApp
():
App
{
return
app
;
}
// TODO 主题切换
export
function
useThemeMode
(
mode
:
ThemeModeEnum
)
{
const
modeRef
=
ref
(
mode
);
...
...
src/views/sys/login/Login.vue
浏览文件 @
968f791f
...
...
@@ -49,8 +49,10 @@
import
{
appStore
}
from
'
/@/store/modules/app
'
;
import
{
useMessage
}
from
'
/@/hooks/web/useMessage
'
;
import
{
useSetting
}
from
'
/@/hooks/core/useSetting
'
;
import
Button
from
'
/@/components/Button/index.vue
'
;
export
default
defineComponent
({
components
:
{
BasicDragVerify
},
components
:
{
BasicDragVerify
,
AButton
:
Button
},
setup
()
{
const
{
globSetting
}
=
useSetting
();
const
{
notification
}
=
useMessage
();
...
...
vite.config.ts
浏览文件 @
968f791f
...
...
@@ -133,8 +133,7 @@ const viteConfig: UserConfig = {
javascriptEnabled
:
true
,
},
},
// 配置Dep优化行为
// 会使用 rollup 对 包重新编译,将编译成符合 esm 模块规范的新的包放入 node_modules 下的 .
// 会使用 rollup 对 包重新编译,将编译成符合 esm 模块规范的新的包放入 node_modules/.vite_opt_cache
optimizeDeps
:
{
include
:
[
'
echarts
'
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录