Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Dr.Disrespect
vue-vben-admin
提交
f5726aa6
V
vue-vben-admin
项目概览
Dr.Disrespect
/
vue-vben-admin
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
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,体验更适合开发者的 AI 搜索 >>
提交
f5726aa6
编写于
12月 31, 2021
作者:
V
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf: Remove some asynchronously loaded components
上级
e07d46ec
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
36 addition
and
57 deletion
+36
-57
packages/admin/src/internal/factory/createAsyncComponent.ts
packages/admin/src/internal/factory/createAsyncComponent.ts
+2
-4
packages/admin/src/internal/factory/index.ts
packages/admin/src/internal/factory/index.ts
+1
-0
packages/admin/src/layouts/default/feature/index.vue
packages/admin/src/layouts/default/feature/index.vue
+4
-10
packages/admin/src/layouts/default/header/components/index.ts
...ages/admin/src/layouts/default/header/components/index.ts
+6
-14
packages/admin/src/layouts/default/header/components/user-dropdown/index.vue
...layouts/default/header/components/user-dropdown/index.vue
+4
-3
packages/admin/src/layouts/default/header/index.vue
packages/admin/src/layouts/default/header/index.vue
+5
-10
packages/admin/src/layouts/default/index.vue
packages/admin/src/layouts/default/index.vue
+4
-7
packages/admin/src/layouts/default/setting/components/index.ts
...ges/admin/src/layouts/default/setting/components/index.ts
+7
-7
packages/admin/src/layouts/default/trigger/index.vue
packages/admin/src/layouts/default/trigger/index.vue
+2
-2
packages/utils/src/util.ts
packages/utils/src/util.ts
+1
-0
未找到文件。
packages/admin/src/
utils/factory/createAsyncComponent.tsx
→
packages/admin/src/
internal/factory/createAsyncComponent.ts
浏览文件 @
f5726aa6
import
{
defineAsyncComponent
}
from
'
vue
'
import
{
defineAsyncComponent
,
h
}
from
'
vue
'
import
{
Spin
}
from
'
ant-design-vue
'
import
{
NOOP
}
from
'
@vben-admin/utils
'
...
...
@@ -20,9 +20,7 @@ export function createAsyncComponent(loader: Fn, options: Options = {}) {
}
=
options
return
defineAsyncComponent
({
loader
,
loadingComponent
:
loading
?
(
<
Spin
spinning
=
{
true
}
size
=
{
size
}
/>
)
:
undefined
,
loadingComponent
:
loading
?
h
(
Spin
,
{
spinning
:
true
,
size
})
:
undefined
,
timeout
,
delay
,
/**
...
...
packages/admin/src/internal/factory/index.ts
0 → 100644
浏览文件 @
f5726aa6
export
{
createAsyncComponent
as
componentFactory
}
from
'
./createAsyncComponent
'
packages/admin/src/layouts/default/feature/index.vue
浏览文件 @
f5726aa6
<
script
lang=
"ts"
>
import
{
defineComponent
,
computed
,
unref
}
from
'
vue
'
import
{
BackTop
}
from
'
ant-design-vue
'
import
{
useRootSetting
}
from
'
/@/hooks/setting/useRootSetting
'
import
{
useHeaderSetting
}
from
'
/@/hooks/setting/useHeaderSetting
'
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
import
{
useUserStoreWithOut
}
from
'
/@/store/modules/user
'
import
{
SettingButtonPositionEnum
}
from
'
@vben-admin/tokens
'
import
{
createAsyncComponent
}
from
'
/@/utils/factory/createAsyncComponent
'
import
SessionTimeoutLogin
from
'
/@/views/sys/login/SessionTimeoutLogin.vue
'
import
LayoutLockPage
from
'
/@/views/sys/lock/index.vue
'
import
SettingDrawer
from
'
/@/layouts/default/setting/index.vue
'
export
default
defineComponent
({
name
:
'
LayoutFeatures
'
,
components
:
{
BackTop
,
LayoutLockPage
:
createAsyncComponent
(
()
=>
import
(
'
/@/views/sys/lock/index.vue
'
),
),
SettingDrawer
:
createAsyncComponent
(
()
=>
import
(
'
/@/layouts/default/setting/index.vue
'
),
),
LayoutLockPage
,
SettingDrawer
,
SessionTimeoutLogin
,
},
setup
()
{
...
...
packages/admin/src/layouts/default/header/components/index.ts
浏览文件 @
f5726aa6
import
{
c
reateAsyncComponent
}
from
'
/@/utils/factory/createAsyncComponent
'
import
{
c
omponentFactory
}
from
'
/@/internal/factory
'
import
FullScreen
from
'
./FullScreen.vue
'
import
UserDropDown
from
'
./user-dropdown/index.vue
'
export
const
UserDropDown
=
createAsyncComponent
(
()
=>
import
(
'
./user-dropdown/index.vue
'
),
{
loading
:
true
,
},
)
export
const
LayoutBreadcrumb
=
createAsyncComponent
(
export
const
LayoutBreadcrumb
=
componentFactory
(
()
=>
import
(
'
./Breadcrumb.vue
'
),
)
export
const
Notify
=
c
reateAsyncComponent
(()
=>
import
(
'
./notify/index.vue
'
))
export
const
Notify
=
c
omponentFactory
(()
=>
import
(
'
./notify/index.vue
'
))
export
const
ErrorAction
=
createAsyncComponent
(
()
=>
import
(
'
./ErrorAction.vue
'
),
)
export
const
ErrorAction
=
componentFactory
(()
=>
import
(
'
./ErrorAction.vue
'
))
export
{
FullScreen
}
export
{
FullScreen
,
UserDropDown
}
packages/admin/src/layouts/default/header/components/user-dropdown/index.vue
浏览文件 @
f5726aa6
...
...
@@ -49,7 +49,8 @@ import { useDesign } from '/@/hooks/web/useDesign'
import
{
useModal
}
from
'
/@/components/Modal
'
import
headerImg
from
'
/@/assets/images/header.jpg
'
import
{
openWindow
}
from
'
@vben-admin/utils
'
import
{
createAsyncComponent
}
from
'
/@/utils/factory/createAsyncComponent
'
import
MenuItem
from
'
./DropMenuItem.vue
'
import
LockAction
from
'
../lock/LockModal.vue
'
type
MenuEvent
=
'
logout
'
|
'
doc
'
|
'
lock
'
...
...
@@ -58,9 +59,9 @@ export default defineComponent({
components
:
{
Dropdown
,
Menu
,
MenuItem
:
createAsyncComponent
(()
=>
import
(
'
./DropMenuItem.vue
'
))
,
MenuItem
,
MenuDivider
:
Menu
.
Divider
,
LockAction
:
createAsyncComponent
(()
=>
import
(
'
../lock/LockModal.vue
'
))
,
LockAction
,
},
props
:
{
theme
:
{
...
...
packages/admin/src/layouts/default/header/index.vue
浏览文件 @
f5726aa6
...
...
@@ -58,7 +58,7 @@
/>
<AppLocalePicker
v-if=
"
getS
howLocalePicker"
v-if=
"
s
howLocalePicker"
:reload=
"true"
:showText=
"false"
:class=
"`$
{prefixCls}-action__item`"
...
...
@@ -102,8 +102,8 @@ import {
import
{
useAppInject
}
from
'
/@/hooks/web/useAppInject
'
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
import
{
createAsyncComponent
}
from
'
/@/utils/factory/createAsyncComponent
'
import
{
useLocale
}
from
'
@vben-admin/locale
'
import
SettingDrawer
from
'
/@/layouts/default/setting/index.vue
'
export
default
defineComponent
({
name
:
'
LayoutHeader
'
,
...
...
@@ -119,12 +119,7 @@ export default defineComponent({
Notify
,
AppSearch
,
ErrorAction
,
SettingDrawer
:
createAsyncComponent
(
()
=>
import
(
'
/@/layouts/default/setting/index.vue
'
),
{
loading
:
true
,
},
),
SettingDrawer
,
},
props
:
{
fixed
:
{
type
:
Boolean
},
...
...
@@ -156,7 +151,7 @@ export default defineComponent({
getShowSearch
,
}
=
useHeaderSetting
()
const
{
getS
howLocalePicker
}
=
useLocale
()
const
{
s
howLocalePicker
}
=
useLocale
()
const
{
getIsMobile
}
=
useAppInject
()
...
...
@@ -213,7 +208,7 @@ export default defineComponent({
getSplit
,
getMenuMode
,
getShowTopMenu
,
getS
howLocalePicker
,
s
howLocalePicker
,
getShowFullScreen
,
getShowNotice
,
getUseErrorHandle
,
...
...
packages/admin/src/layouts/default/index.vue
浏览文件 @
f5726aa6
...
...
@@ -16,7 +16,6 @@
<
script
lang=
"ts"
>
import
{
defineComponent
,
computed
,
unref
}
from
'
vue
'
import
{
Layout
}
from
'
ant-design-vue
'
import
{
createAsyncComponent
}
from
'
/@/utils/factory/createAsyncComponent
'
import
LayoutHeader
from
'
./header/index.vue
'
import
LayoutContent
from
'
./content/index.vue
'
...
...
@@ -27,16 +26,14 @@ import { useMenuSetting } from '/@/hooks/setting/useMenuSetting'
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
import
{
useLockPage
}
from
'
/@/hooks/web/useLockPage
'
import
{
useAppInject
}
from
'
/@/hooks/web/useAppInject
'
import
LayoutFeatures
from
'
/@/layouts/default/feature/index.vue
'
import
LayoutFooter
from
'
/@/layouts/default/footer/index.vue
'
export
default
defineComponent
({
name
:
'
DefaultLayout
'
,
components
:
{
LayoutFeatures
:
createAsyncComponent
(
()
=>
import
(
'
/@/layouts/default/feature/index.vue
'
),
),
LayoutFooter
:
createAsyncComponent
(
()
=>
import
(
'
/@/layouts/default/footer/index.vue
'
),
),
LayoutFeatures
,
LayoutFooter
,
LayoutHeader
,
LayoutContent
,
LayoutSideBar
,
...
...
packages/admin/src/layouts/default/setting/components/index.ts
浏览文件 @
f5726aa6
import
{
c
reateAsyncComponent
}
from
'
/@/utils/factory/createAsyncComponent
'
import
{
c
omponentFactory
}
from
'
/@/internal/factory
'
export
const
TypePicker
=
c
reateAsyncComponent
(()
=>
import
(
'
./TypePicker.vue
'
))
export
const
ThemeColorPicker
=
c
reateAsyncComponent
(
export
const
TypePicker
=
c
omponentFactory
(()
=>
import
(
'
./TypePicker.vue
'
))
export
const
ThemeColorPicker
=
c
omponentFactory
(
()
=>
import
(
'
./ThemeColorPicker.vue
'
),
)
export
const
SettingFooter
=
c
reateAsyncComponent
(
export
const
SettingFooter
=
c
omponentFactory
(
()
=>
import
(
'
./SettingFooter.vue
'
),
)
export
const
SwitchItem
=
c
reateAsyncComponent
(()
=>
import
(
'
./SwitchItem.vue
'
))
export
const
SelectItem
=
c
reateAsyncComponent
(()
=>
import
(
'
./SelectItem.vue
'
))
export
const
InputNumberItem
=
c
reateAsyncComponent
(
export
const
SwitchItem
=
c
omponentFactory
(()
=>
import
(
'
./SwitchItem.vue
'
))
export
const
SelectItem
=
c
omponentFactory
(()
=>
import
(
'
./SelectItem.vue
'
))
export
const
InputNumberItem
=
c
omponentFactory
(
()
=>
import
(
'
./InputNumberItem.vue
'
),
)
packages/admin/src/layouts/default/trigger/index.vue
浏览文件 @
f5726aa6
...
...
@@ -4,13 +4,13 @@
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
}
from
'
vue
'
import
{
createAsyncComponent
}
from
'
/@/utils/factory/createAsyncComponent
'
import
SiderTrigger
from
'
./SiderTrigger.vue
'
import
HeaderTrigger
from
'
./HeaderTrigger.vue
'
export
default
defineComponent
({
name
:
'
LayoutTrigger
'
,
components
:
{
SiderTrigger
:
createAsyncComponent
(()
=>
import
(
'
./SiderTrigger.vue
'
))
,
SiderTrigger
,
HeaderTrigger
:
HeaderTrigger
,
},
props
:
{
...
...
packages/utils/src/util.ts
浏览文件 @
f5726aa6
import
{
unref
}
from
'
vue
'
// dynamic use hook props
export
const
getDynamicProps
=
<
T
,
U
>
(
props
:
T
):
Partial
<
U
>
=>
{
const
ret
:
Recordable
=
{}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录