Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
unidocs-zh
提交
5f7c7551
unidocs-zh
项目概览
DCloud
/
unidocs-zh
通知
3172
Star
105
Fork
804
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
93
列表
看板
标记
里程碑
合并请求
67
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
unidocs-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
93
Issue
93
列表
看板
标记
里程碑
合并请求
67
合并请求
67
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
5f7c7551
编写于
5月 06, 2022
作者:
D
DCloud_LXH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 下拉显示一级菜单,搜索框下沉
上级
53dc16a5
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
48 addition
and
8 deletion
+48
-8
docs/.vuepress/theme/components/AlgoliaSearchBox.vue
docs/.vuepress/theme/components/AlgoliaSearchBox.vue
+2
-2
docs/.vuepress/theme/components/Navbar.vue
docs/.vuepress/theme/components/Navbar.vue
+30
-6
docs/.vuepress/theme/config/navbar.js
docs/.vuepress/theme/config/navbar.js
+1
-0
docs/.vuepress/theme/styles/navbar.styl
docs/.vuepress/theme/styles/navbar.styl
+15
-0
未找到文件。
docs/.vuepress/theme/components/AlgoliaSearchBox.vue
浏览文件 @
5f7c7551
...
...
@@ -61,11 +61,11 @@
flex-direction column
justify-content center
#docsearch span
@media (min-width:
$MQMobile
)
@media (min-width:
1200px
)
&
display flex
@media (max-width:
$MQMobile
)
@media (max-width:
1200px
)
:root
--docsearch-spacing 10px
--docsearch-footer-height 40px
...
...
docs/.vuepress/theme/components/Navbar.vue
浏览文件 @
5f7c7551
...
...
@@ -30,9 +30,7 @@
<div
class=
"links"
:style=
"linksWrapMaxWidth ? {
'max-width': linksWrapMaxWidth + 'px'
} : {}"
:style=
"SearchBoxStyle"
>
<!-- <a class="switch-version" href="javascript:void(0)">回到旧版</a> -->
<DcloudSearchPage
v-if=
"isAlgoliaSearch"
ref=
"dcloudSearchPage"
:options=
"algolia"
/>
...
...
@@ -42,6 +40,14 @@
</div>
<div
class=
"sub-navbar"
>
<DropdownLink
class=
"custom-main-navbar can-hide"
v-if=
"showSubNavBar && fixedNavbar"
:item=
"{
text: customNavBarKeys[navConfig.userNavIndex],
items: customNavBar
}"
/>
<NavLinks
class=
"can-hide"
/>
<div
class=
"mobile-sub-navbar"
>
<div
class=
"subnavbar__item"
@
click=
"$emit('toggle-sidebar')"
>
...
...
@@ -61,6 +67,7 @@ import MainNavbarLink from './MainNavbarLink.vue';
import
NavbarLogo
from
'
./NavbarLogo.vue
'
;
import
DcloudSearchPage
from
'
./DcloudSearchPage
'
;
import
navInject
from
'
../mixin/navInject
'
;
import
DropdownLink
from
'
@theme/components/DropdownLink.vue
'
import
{
forbidScroll
,
os
}
from
'
../util
'
;
export
default
{
...
...
@@ -75,14 +82,16 @@ export default {
SearchBox
,
AlgoliaSearchBox
,
NavbarLogo
,
DcloudSearchPage
DcloudSearchPage
,
DropdownLink
},
data
()
{
return
{
linksWrapMaxWidth
:
null
,
showMobilePanel
:
false
,
fixedNavbar
:
false
fixedNavbar
:
false
,
SearchBoxTop
:
0
}
},
...
...
@@ -93,6 +102,18 @@ export default {
isAlgoliaSearch
()
{
return
this
.
algolia
&&
this
.
algolia
.
apiKey
&&
this
.
algolia
.
indexName
},
SearchBoxStyle
()
{
const
initStyle
=
{
top
:
`
${
this
.
SearchBoxTop
}
px`
,
zIndex
:
100
};
return
this
.
linksWrapMaxWidth
?
Object
.
assign
({},
initStyle
,
{
'
max-width
'
:
this
.
linksWrapMaxWidth
+
'
px
'
,
})
:
initStyle
;
}
},
...
...
@@ -148,7 +169,7 @@ export default {
this
.
vuepressToc
&&
this
.
vuepressToc
.
removeAttribute
(
'
style
'
)
this
.
navbar
&&
this
.
navbar
.
removeAttribute
(
'
style
'
)
if
(
this
.
pageContainer
)
{
this
.
pageContainer
.
style
.
marginTop
=
this
.
showSubNavBar
?
'
auto
'
:
`
${
this
.
navbarHeight
}
px`
this
.
pageContainer
.
style
.
marginTop
=
this
.
showSubNavBar
||
!
os
.
pc
?
'
auto
'
:
`
${
this
.
navbarHeight
}
px`
}
},
onWindowScroll
()
{
...
...
@@ -165,6 +186,7 @@ export default {
if
(
!
this
.
fixedNavbar
)
{
this
.
fixedNavbar
=
true
this
.
navbar
.
style
.
top
=
`-
${
this
.
mainNavBarHeight
}
px`
this
.
SearchBoxTop
=
this
.
mainNavBarHeight
+
(
this
.
subNavBarHeight
-
this
.
mainNavBarHeight
)
/
2
this
.
$nextTick
(()
=>
{
this
.
pageContainer
&&
(
this
.
pageContainer
.
style
.
marginTop
=
`
${
this
.
navbarHeight
}
px`
)
})
...
...
@@ -173,6 +195,7 @@ export default {
if
(
this
.
fixedNavbar
)
{
this
.
fixedNavbar
=
false
this
.
pageContainer
&&
(
this
.
pageContainer
.
style
.
marginTop
=
'
auto
'
)
this
.
SearchBoxTop
=
0
}
}
},
...
...
@@ -264,6 +287,7 @@ $navbar-horizontal-padding = 1.5rem
display none !important
.links
padding-left 0rem // 1.5rem
top 0 !important
.site-name
width calc(100vw - 9.4rem)
overflow hidden
...
...
docs/.vuepress/theme/config/navbar.js
浏览文件 @
5f7c7551
...
...
@@ -10,6 +10,7 @@
export
const
navbar
=
[
{
text
:
'
uni-app
'
,
link
:
'
/
'
,
items
:
[
{
text
:
'
介绍
'
,
...
...
docs/.vuepress/theme/styles/navbar.styl
浏览文件 @
5f7c7551
...
...
@@ -20,6 +20,7 @@ $navbar-logo-height = $navbar-main-navbar-height - 2rem
&
display none
.sub-navbar
position relative
line-height $navbar-sub-navbar-height
border-top-width 1px
.mobile-main-navbar
...
...
@@ -76,6 +77,20 @@ $navbar-logo-height = $navbar-main-navbar-height - 2rem
color inherit
&:hover
color $accentColor
.custom-main-navbar
position absolute
height 30px
top calc(50% - 15px)
left 2rem
@media (max-width: 1200px)
display none
a
color inherit
.nav-dropdown
right auto
left 0
z-index 12
@media (max-width: $MQMobile)
$navbar-a-color = #222;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录