Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
f81c4019
提交
f81c4019
authored
12月 13, 2020
作者:
vben
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
perf(tabs): perf multiple-tabs
上级
27e50b47
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
3 行增加
和
95 行删除
+3
-95
index.less
src/layouts/default/index.less
+0
-17
index.tsx
src/layouts/default/index.tsx
+0
-75
useLayoutContext.ts
src/layouts/default/useLayoutContext.ts
+3
-3
没有找到文件。
src/layouts/default/index.less
deleted
100644 → 0
浏览文件 @
27e50b47
@import (reference) '../../design/index.less';
.default-layout {
display: flex;
width: 100%;
min-height: 100%;
background: @content-bg;
flex-direction: column;
> .ant-layout {
min-height: 100%;
}
&__main {
margin-left: 1px;
}
}
src/layouts/default/index.tsx
deleted
100644 → 0
浏览文件 @
27e50b47
import
'./index.less'
;
import
{
defineComponent
,
unref
,
ref
}
from
'vue'
;
import
{
Layout
}
from
'ant-design-vue'
;
import
{
createAsyncComponent
}
from
'/@/utils/factory/createAsyncComponent'
;
import
LayoutHeader
from
'./header/LayoutHeader'
;
import
LayoutContent
from
'./content/index.vue'
;
import
LayoutSideBar
from
'./sider'
;
import
LayoutMultipleHeader
from
'./header/LayoutMultipleHeader'
;
import
{
useHeaderSetting
}
from
'/@/hooks/setting/useHeaderSetting'
;
import
{
useMenuSetting
}
from
'/@/hooks/setting/useMenuSetting'
;
import
{
createLayoutContext
}
from
'./useLayoutContext'
;
import
{
registerGlobComp
}
from
'/@/components/registerGlobComp'
;
import
{
createBreakpointListen
}
from
'/@/hooks/event/useBreakpoint'
;
import
{
isMobile
}
from
'/@/utils/is'
;
const
LayoutFeatures
=
createAsyncComponent
(()
=>
import
(
'/@/layouts/default/feature/index.vue'
));
const
LayoutFooter
=
createAsyncComponent
(()
=>
import
(
'/@/layouts/default/footer/index.vue'
));
export
default
defineComponent
({
name
:
'DefaultLayout'
,
setup
()
{
const
headerRef
=
ref
<
ComponentRef
>
(
null
);
const
isMobileRef
=
ref
(
false
);
createLayoutContext
({
fullHeader
:
headerRef
,
isMobile
:
isMobileRef
});
createBreakpointListen
(()
=>
{
isMobileRef
.
value
=
isMobile
();
});
// ! Only register global components here
// ! Can reduce the size of the first screen code
// default layout It is loaded after login. So it won’t be packaged to the first screen
registerGlobComp
();
const
{
getShowFullHeaderRef
}
=
useHeaderSetting
();
const
{
getShowSidebar
}
=
useMenuSetting
();
return
()
=>
{
return
(
<
Layout
class=
"default-layout"
>
{
()
=>
(
<>
<
LayoutFeatures
/>
{
unref
(
getShowFullHeaderRef
)
&&
<
LayoutHeader
fixed=
{
true
}
ref=
{
headerRef
}
/>
}
<
Layout
>
{
()
=>
(
<>
{
unref
(
getShowSidebar
)
&&
<
LayoutSideBar
/>
}
<
Layout
class=
"default-layout__main"
>
{
()
=>
(
<>
<
LayoutMultipleHeader
/>
<
LayoutContent
/>
<
LayoutFooter
/>
</>
)
}
</
Layout
>
</>
)
}
</
Layout
>
</>
)
}
</
Layout
>
);
};
},
});
src/layouts/default/useLayoutContext.ts
浏览文件 @
f81c4019
...
...
@@ -6,12 +6,12 @@ export interface LayoutContextProps {
isMobile
:
Ref
<
boolean
>
;
}
const
layoutContextInjectK
ey
:
InjectionKey
<
LayoutContextProps
>
=
Symbol
();
const
k
ey
:
InjectionKey
<
LayoutContextProps
>
=
Symbol
();
export
function
createLayoutContext
(
context
:
LayoutContextProps
)
{
return
createContext
<
LayoutContextProps
>
(
context
,
layoutContextInjectK
ey
);
return
createContext
<
LayoutContextProps
>
(
context
,
k
ey
);
}
export
function
useLayoutContext
()
{
return
useContext
<
LayoutContextProps
>
(
layoutContextInjectK
ey
);
return
useContext
<
LayoutContextProps
>
(
k
ey
);
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论