Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-vue-admin
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-vue-admin
Commits
33cd8fe6
Unverified
提交
33cd8fe6
authored
6月 11, 2021
作者:
Lan
提交者:
GitHub
6月 11, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(useViewHeight): Fix the problem that useContentViewHeight does not calculate the footer (#747)
Co-authored-by: NorthLan <lan6995@gmail.com>
上级
c6b766d8
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
42 行增加
和
6 行删除
+42
-6
PageWrapper.vue
src/components/Page/src/PageWrapper.vue
+4
-1
useContentViewHeight.ts
src/layouts/default/content/useContentViewHeight.ts
+13
-1
index.vue
src/layouts/default/footer/index.vue
+22
-2
MultipleHeader.vue
src/layouts/default/header/MultipleHeader.vue
+3
-2
没有找到文件。
src/components/Page/src/PageWrapper.vue
浏览文件 @
33cd8fe6
...
@@ -44,6 +44,8 @@
...
@@ -44,6 +44,8 @@
import
{
omit
}
from
'lodash-es'
;
import
{
omit
}
from
'lodash-es'
;
import
{
PageHeader
}
from
'ant-design-vue'
;
import
{
PageHeader
}
from
'ant-design-vue'
;
import
{
onMountedOrActivated
}
from
'/@/hooks/core/onMountedOrActivated'
;
import
{
onMountedOrActivated
}
from
'/@/hooks/core/onMountedOrActivated'
;
import
{
useLayoutHeight
}
from
'/@/layouts/default/content/useContentViewHeight'
;
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'PageWrapper'
,
name
:
'PageWrapper'
,
components
:
{
PageFooter
,
PageHeader
},
components
:
{
PageFooter
,
PageHeader
},
...
@@ -67,6 +69,7 @@
...
@@ -67,6 +69,7 @@
const
footerHeight
=
ref
(
0
);
const
footerHeight
=
ref
(
0
);
const
{
prefixCls
,
prefixVar
}
=
useDesign
(
'page-wrapper'
);
const
{
prefixCls
,
prefixVar
}
=
useDesign
(
'page-wrapper'
);
const
{
contentHeight
,
setPageHeight
,
pageHeight
}
=
usePageContext
();
const
{
contentHeight
,
setPageHeight
,
pageHeight
}
=
usePageContext
();
const
{
footerHeightRef
}
=
useLayoutHeight
();
const
getClass
=
computed
(()
=>
{
const
getClass
=
computed
(()
=>
{
return
[
return
[
...
@@ -109,7 +112,7 @@
...
@@ -109,7 +112,7 @@
});
});
watch
(
watch
(
()
=>
[
contentHeight
?.
value
,
getShowFooter
.
value
],
()
=>
[
contentHeight
?.
value
,
getShowFooter
.
value
,
footerHeightRef
.
value
],
()
=>
{
()
=>
{
calcContentHeight
();
calcContentHeight
();
},
},
...
...
src/layouts/default/content/useContentViewHeight.ts
浏览文件 @
33cd8fe6
import
{
ref
,
computed
,
unref
}
from
'vue'
;
import
{
ref
,
computed
,
unref
}
from
'vue'
;
import
{
createPageContext
}
from
'/@/hooks/component/usePageContext'
;
import
{
createPageContext
}
from
'/@/hooks/component/usePageContext'
;
import
{
useWindowSizeFn
}
from
'/@/hooks/event/useWindowSizeFn'
;
import
{
useWindowSizeFn
}
from
'/@/hooks/event/useWindowSizeFn'
;
export
const
headerHeightRef
=
ref
(
0
);
const
headerHeightRef
=
ref
(
0
);
const
footerHeightRef
=
ref
(
0
);
export
function
useLayoutHeight
()
{
function
setHeaderHeight
(
val
)
{
headerHeightRef
.
value
=
val
;
}
function
setFooterHeight
(
val
)
{
footerHeightRef
.
value
=
val
;
}
return
{
headerHeightRef
,
footerHeightRef
,
setHeaderHeight
,
setFooterHeight
};
}
export
function
useContentViewHeight
()
{
export
function
useContentViewHeight
()
{
const
contentHeight
=
ref
(
window
.
innerHeight
);
const
contentHeight
=
ref
(
window
.
innerHeight
);
...
...
src/layouts/default/footer/index.vue
浏览文件 @
33cd8fe6
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
</
template
>
</
template
>
<
script
lang=
"ts"
>
<
script
lang=
"ts"
>
import
{
computed
,
defineComponent
,
unref
}
from
'vue'
;
import
{
computed
,
defineComponent
,
unref
,
ref
}
from
'vue'
;
import
{
Layout
}
from
'ant-design-vue'
;
import
{
Layout
}
from
'ant-design-vue'
;
import
{
GithubFilled
}
from
'@ant-design/icons-vue'
;
import
{
GithubFilled
}
from
'@ant-design/icons-vue'
;
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
import
{
useRootSetting
}
from
'/@/hooks/setting/useRootSetting'
;
import
{
useRootSetting
}
from
'/@/hooks/setting/useRootSetting'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
useRouter
}
from
'vue-router'
;
import
{
useDesign
}
from
'/@/hooks/web/useDesign'
;
import
{
useDesign
}
from
'/@/hooks/web/useDesign'
;
import
{
useLayoutHeight
}
from
'../content/useContentViewHeight'
;
export
default
defineComponent
({
export
default
defineComponent
({
name
:
'LayoutFooter'
,
name
:
'LayoutFooter'
,
...
@@ -34,10 +35,29 @@
...
@@ -34,10 +35,29 @@
const
{
currentRoute
}
=
useRouter
();
const
{
currentRoute
}
=
useRouter
();
const
{
prefixCls
}
=
useDesign
(
'layout-footer'
);
const
{
prefixCls
}
=
useDesign
(
'layout-footer'
);
const
footerRef
=
ref
<
ComponentRef
>
(
null
);
const
{
setFooterHeight
}
=
useLayoutHeight
();
const
getShowLayoutFooter
=
computed
(()
=>
{
const
getShowLayoutFooter
=
computed
(()
=>
{
if
(
unref
(
getShowFooter
))
{
const
footerEl
=
unref
(
footerRef
)?.
$el
;
setFooterHeight
(
footerEl
?.
offsetHeight
||
0
);
}
else
{
setFooterHeight
(
0
);
}
return
unref
(
getShowFooter
)
&&
!
unref
(
currentRoute
).
meta
?.
hiddenFooter
;
return
unref
(
getShowFooter
)
&&
!
unref
(
currentRoute
).
meta
?.
hiddenFooter
;
});
});
return
{
getShowLayoutFooter
,
prefixCls
,
t
,
DOC_URL
,
GITHUB_URL
,
SITE_URL
,
openWindow
};
return
{
getShowLayoutFooter
,
prefixCls
,
t
,
DOC_URL
,
GITHUB_URL
,
SITE_URL
,
openWindow
,
footerRef
,
};
},
},
});
});
</
script
>
</
script
>
...
...
src/layouts/default/header/MultipleHeader.vue
浏览文件 @
33cd8fe6
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
import
{
useMultipleTabSetting
}
from
'/@/hooks/setting/useMultipleTabSetting'
;
import
{
useMultipleTabSetting
}
from
'/@/hooks/setting/useMultipleTabSetting'
;
import
{
useAppInject
}
from
'/@/hooks/web/useAppInject'
;
import
{
useAppInject
}
from
'/@/hooks/web/useAppInject'
;
import
{
useDesign
}
from
'/@/hooks/web/useDesign'
;
import
{
useDesign
}
from
'/@/hooks/web/useDesign'
;
import
{
headerHeightRef
}
from
'../content/useContentViewHeight'
;
import
{
useLayoutHeight
}
from
'../content/useContentViewHeight'
;
const
HEADER_HEIGHT
=
48
;
const
HEADER_HEIGHT
=
48
;
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
name
:
'LayoutMultipleHeader'
,
name
:
'LayoutMultipleHeader'
,
components
:
{
LayoutHeader
,
MultipleTabs
},
components
:
{
LayoutHeader
,
MultipleTabs
},
setup
()
{
setup
()
{
const
{
setHeaderHeight
}
=
useLayoutHeight
();
const
{
prefixCls
}
=
useDesign
(
'layout-multiple-header'
);
const
{
prefixCls
}
=
useDesign
(
'layout-multiple-header'
);
const
{
getCalcContentWidth
,
getSplit
}
=
useMenuSetting
();
const
{
getCalcContentWidth
,
getSplit
}
=
useMenuSetting
();
...
@@ -77,7 +78,7 @@
...
@@ -77,7 +78,7 @@
if
(
unref
(
getShowMultipleTab
)
&&
!
unref
(
getFullContent
))
{
if
(
unref
(
getShowMultipleTab
)
&&
!
unref
(
getFullContent
))
{
height
+=
TABS_HEIGHT
;
height
+=
TABS_HEIGHT
;
}
}
headerHeightRef
.
value
=
height
;
setHeaderHeight
(
height
)
;
return
{
return
{
height
:
`
${
height
}
px`
,
height
:
`
${
height
}
px`
,
};
};
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论