Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
968f791f
提交
968f791f
authored
10月 20, 2020
作者:
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf: optimize the size of the first screen
上级
c2333f5d
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
43 行增加
和
26 行删除
+43
-26
CHANGELOG.zh_CN.md
CHANGELOG.zh_CN.md
+11
-0
useProps.ts
src/components/Table/src/hooks/useProps.ts
+0
-9
props.ts
src/components/Table/src/props.ts
+1
-1
registerGlobComp.ts
src/components/registerGlobComp.ts
+5
-4
index.tsx
src/layouts/default/index.tsx
+6
-1
index.vue
src/layouts/default/setting/index.vue
+1
-1
main.ts
src/main.ts
+3
-4
index.ts
src/setup/ant-design-vue/index.ts
+2
-2
useApp.ts
src/useApp.ts
+10
-1
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)
# 2.0.0-rc.3 (2020-10-19)
### ✨ Features
### ✨ 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
{
Ref
,
ref
,
watch
,
unref
}
from
'vue'
;
import
{
BasicTableProps
}
from
'../types/table'
;
import
{
BasicTableProps
}
from
'../types/table'
;
...
...
src/components/Table/src/props.ts
浏览文件 @
968f791f
...
@@ -133,7 +133,7 @@ export const basicProps = {
...
@@ -133,7 +133,7 @@ export const basicProps = {
},
},
bordered
:
{
bordered
:
{
type
:
Boolean
as
PropType
<
boolean
>
,
type
:
Boolean
as
PropType
<
boolean
>
,
default
:
tru
e
,
default
:
fals
e
,
},
},
pagination
:
{
pagination
:
{
type
:
[
Object
,
Boolean
]
as
PropType
<
PaginationProps
|
boolean
>
,
type
:
[
Object
,
Boolean
]
as
PropType
<
PaginationProps
|
boolean
>
,
...
...
src/components/registerGlobComp.ts
浏览文件 @
968f791f
import
Icon
from
'./Icon/index'
;
import
Icon
from
'./Icon/index'
;
import
{
BasicHelp
,
BasicTitle
}
from
'./Basic'
;
import
{
BasicHelp
,
BasicTitle
}
from
'./Basic'
;
import
Button
from
'./Button/index.vue'
;
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
];
const
compList
=
[
Icon
,
BasicHelp
,
BasicTitle
,
Button
,
AntButton
.
Group
];
export
function
registerGlobComp
(
app
:
App
<
Element
>
)
{
export
function
registerGlobComp
()
{
compList
.
forEach
((
comp
:
any
)
=>
{
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';
...
@@ -13,12 +13,17 @@ import { MenuModeEnum, MenuTypeEnum } from '/@/enums/menuEnum';
import
{
useFullContent
}
from
'/@/hooks/web/useFullContent'
;
import
{
useFullContent
}
from
'/@/hooks/web/useFullContent'
;
import
LockPage
from
'/@/views/sys/lock/index.vue'
;
import
LockPage
from
'/@/views/sys/lock/index.vue'
;
import
{
registerGlobComp
}
from
'/@/components/registerGlobComp'
;
import
'./index.less'
;
import
'./index.less'
;
// import { userStore } from '/@/store/modules/user';
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'DefaultLayout'
,
name
:
'DefaultLayout'
,
setup
()
{
setup
()
{
// ! 在这里才注册全局组件
// ! 可以减少首屏代码体积
// default layout是在登录后才加载的。所以不会打包到首屏去
registerGlobComp
();
// 获取项目配置
// 获取项目配置
const
{
getFullContent
}
=
useFullContent
();
const
{
getFullContent
}
=
useFullContent
();
...
...
src/layouts/default/setting/index.vue
浏览文件 @
968f791f
<
template
>
<
template
>
<div
@
click=
"openDrawer"
class=
"setting-button"
>
<div
@
click=
"openDrawer"
class=
"setting-button"
>
<SettingOutlined
:spin=
"true"
/>
<SettingOutlined
/>
<SettingDrawer
@
register=
"register"
/>
<SettingDrawer
@
register=
"register"
/>
</div>
</div>
</
template
>
</
template
>
...
...
src/main.ts
浏览文件 @
968f791f
...
@@ -6,9 +6,9 @@ import { setupAntd } from '/@/setup/ant-design-vue';
...
@@ -6,9 +6,9 @@ import { setupAntd } from '/@/setup/ant-design-vue';
import
{
setupErrorHandle
}
from
'/@/setup/error-handle/index'
;
import
{
setupErrorHandle
}
from
'/@/setup/error-handle/index'
;
import
{
setupDirectives
}
from
'/@/setup/directives/index'
;
import
{
setupDirectives
}
from
'/@/setup/directives/index'
;
import
{
registerGlobComp
}
from
'/@/components/registerGlobComp'
;
import
{
isDevMode
,
isProdMode
,
isUseMock
}
from
'/@/utils/env'
;
import
{
isDevMode
,
isProdMode
,
isUseMock
}
from
'/@/utils/env'
;
import
{
setupProdMockServer
}
from
'../mock/_createProductionServer'
;
import
{
setupProdMockServer
}
from
'../mock/_createProductionServer'
;
import
{
setApp
}
from
'./useApp'
;
import
App
from
'./App.vue'
;
import
App
from
'./App.vue'
;
import
'/@/design/index.less'
;
import
'/@/design/index.less'
;
...
@@ -26,8 +26,6 @@ setupDirectives(app);
...
@@ -26,8 +26,6 @@ setupDirectives(app);
setupErrorHandle
(
app
);
setupErrorHandle
(
app
);
registerGlobComp
(
app
);
router
.
isReady
().
then
(()
=>
{
router
.
isReady
().
then
(()
=>
{
app
.
mount
(
'#app'
);
app
.
mount
(
'#app'
);
});
});
...
@@ -40,4 +38,5 @@ if (isDevMode()) {
...
@@ -40,4 +38,5 @@ if (isDevMode()) {
if
(
isProdMode
()
&&
isUseMock
())
{
if
(
isProdMode
()
&&
isUseMock
())
{
setupProdMockServer
();
setupProdMockServer
();
}
}
export
default
app
;
setApp
(
app
);
src/setup/ant-design-vue/index.ts
浏览文件 @
968f791f
...
@@ -2,13 +2,13 @@
...
@@ -2,13 +2,13 @@
import
type
{
App
}
from
'vue'
;
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
'ant-design-vue/dist/antd.css'
;
import
'./spin'
;
import
'./spin'
;
export
function
setupAntd
(
app
:
App
<
Element
>
)
{
export
function
setupAntd
(
app
:
App
<
Element
>
)
{
app
.
component
(
Button
.
Group
.
name
,
Button
.
Group
);
// 这两个组件在登录也就用。全局注册
app
.
use
(
Form
);
app
.
use
(
Form
);
app
.
use
(
Input
);
app
.
use
(
Input
);
}
}
src/useApp.ts
浏览文件 @
968f791f
import
type
{
ProjectConfig
}
from
'/@/types/config'
;
import
type
{
ProjectConfig
}
from
'/@/types/config'
;
import
type
{
App
}
from
'vue'
;
import
{
computed
,
ref
}
from
'vue'
;
import
{
computed
,
ref
}
from
'vue'
;
import
{
ThemeModeEnum
}
from
'/@/enums/appEnum'
;
import
{
ThemeModeEnum
}
from
'/@/enums/appEnum'
;
...
@@ -17,6 +17,15 @@ import { PageEnum } from '/@/enums/pageEnum';
...
@@ -17,6 +17,15 @@ import { PageEnum } from '/@/enums/pageEnum';
import
{
useTimeout
}
from
'/@/hooks/core/useTimeout'
;
import
{
useTimeout
}
from
'/@/hooks/core/useTimeout'
;
import
{
ExceptionEnum
}
from
'/@/enums/exceptionEnum'
;
import
{
ExceptionEnum
}
from
'/@/enums/exceptionEnum'
;
let
app
:
App
;
export
function
setApp
(
_app
:
App
):
void
{
app
=
_app
;
}
export
function
getApp
():
App
{
return
app
;
}
// TODO 主题切换
// TODO 主题切换
export
function
useThemeMode
(
mode
:
ThemeModeEnum
)
{
export
function
useThemeMode
(
mode
:
ThemeModeEnum
)
{
const
modeRef
=
ref
(
mode
);
const
modeRef
=
ref
(
mode
);
...
...
src/views/sys/login/Login.vue
浏览文件 @
968f791f
...
@@ -49,8 +49,10 @@
...
@@ -49,8 +49,10 @@
import
{
appStore
}
from
'/@/store/modules/app'
;
import
{
appStore
}
from
'/@/store/modules/app'
;
import
{
useMessage
}
from
'/@/hooks/web/useMessage'
;
import
{
useMessage
}
from
'/@/hooks/web/useMessage'
;
import
{
useSetting
}
from
'/@/hooks/core/useSetting'
;
import
{
useSetting
}
from
'/@/hooks/core/useSetting'
;
import
Button
from
'/@/components/Button/index.vue'
;
export
default
defineComponent
({
export
default
defineComponent
({
components
:
{
BasicDragVerify
},
components
:
{
BasicDragVerify
,
AButton
:
Button
},
setup
()
{
setup
()
{
const
{
globSetting
}
=
useSetting
();
const
{
globSetting
}
=
useSetting
();
const
{
notification
}
=
useMessage
();
const
{
notification
}
=
useMessage
();
...
...
vite.config.ts
浏览文件 @
968f791f
...
@@ -133,8 +133,7 @@ const viteConfig: UserConfig = {
...
@@ -133,8 +133,7 @@ const viteConfig: UserConfig = {
javascriptEnabled
:
true
,
javascriptEnabled
:
true
,
},
},
},
},
// 配置Dep优化行为
// 会使用 rollup 对 包重新编译,将编译成符合 esm 模块规范的新的包放入 node_modules/.vite_opt_cache
// 会使用 rollup 对 包重新编译,将编译成符合 esm 模块规范的新的包放入 node_modules 下的 .
optimizeDeps
:
{
optimizeDeps
:
{
include
:
[
include
:
[
'echarts'
,
'echarts'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论