diff --git a/docs/.vuepress/theme/components/Navbar.vue b/docs/.vuepress/theme/components/Navbar.vue index d9e5ab3e58e2b24f8beef9a30686e7c5f2636290..cb836d610cede51afb13b7197c6ba329510ef109 100644 --- a/docs/.vuepress/theme/components/Navbar.vue +++ b/docs/.vuepress/theme/components/Navbar.vue @@ -125,9 +125,19 @@ export default { this.navbarHeight = this.navbar.clientHeight this.subNavBarHeight = this.subNavBar.clientHeight this.mainNavBarHeight = this.mainNavBar.clientHeight + this.scrollBehavior() + }, + scrollBehavior () { this.removeWindowScroll() + this.onWindowScroll() + if(this.showSubNavBar) { + this.addWindowScroll() + } else { + this.fixedNavbar = true + } + }, + addWindowScroll () { if (os.pc) { - this.onWindowScroll() window.addEventListener('scroll', this.onWindowScroll, false) } }, @@ -137,10 +147,12 @@ export default { this.sideBar && this.sideBar.removeAttribute('style') this.vuepressToc && this.vuepressToc.removeAttribute('style') this.navbar && this.navbar.removeAttribute('style') - this.pageContainer && (this.pageContainer.style.marginTop = 'auto') + if (this.pageContainer) { + this.pageContainer.style.marginTop = this.showSubNavBar ? 'auto' : `${this.navbarHeight}px` + } }, onWindowScroll () { - const scrollTop = document.documentElement.scrollTop || document.body.scrollTop; + const scrollTop = !this.showSubNavBar ? 0 : document.documentElement.scrollTop || document.body.scrollTop; if (!this.fixedNavbar) { let sideTop = this.navbarHeight - scrollTop @@ -190,10 +202,12 @@ export default { watch: { fixedNavbar () { this.fixedSideBarHeight() + this.scrollBehavior() }, 'navConfig.userNavIndex' () { this.$nextTick(()=>{ this.fixedSideBarHeight() + this.scrollBehavior() }) } } diff --git a/docs/.vuepress/theme/config/navbar.js b/docs/.vuepress/theme/config/navbar.js index d26f7f4f5604d840181d7a55ea30cb3c0ce323b8..599bb2795445ddaecca7966e066008a001a9d267 100644 --- a/docs/.vuepress/theme/config/navbar.js +++ b/docs/.vuepress/theme/config/navbar.js @@ -96,11 +96,11 @@ export const navbar = [ type: 'link', link: 'https://mp.kuaishou.com/docs/develop/frame/config/conf_appjson.html' }, - { - text: '京东小程序', - type: 'link', - link: 'https://mp-docs.jd.com/framework/' - }, + { + text: '京东小程序', + type: 'link', + link: 'https://mp-docs.jd.com/framework/' + }, { text: '华为快应用', type: 'link', @@ -118,12 +118,12 @@ export const navbar = [ }, ] }, - /* { + { link: "https://github.com/dcloudio/uni-app", target: "_blank", text: "GitHub", type: "link" - } */ + } ] }, { diff --git a/docs/api/plugins/getEnterOptionsSync.md b/docs/api/plugins/getEnterOptionsSync.md index 89200c92bb56bf0e6bee5d9270a97a95408fc052..c31ec63d8bb600ca5b4a6c509b6ddad30825aff2 100644 --- a/docs/api/plugins/getEnterOptionsSync.md +++ b/docs/api/plugins/getEnterOptionsSync.md @@ -14,7 +14,7 @@ |scene|Number|启动时的场景值,具体值含义请查看各平台文档说明|其他平台均支持,`字节小程序(1.12.0)`| |query|Object|启动时的 query 参数|其他平台均支持,`字节小程序(1.12.0)`| |referrerInfo|Object|来源信息。如果没有则返回 `{}`|其他平台均支持,`字节小程序(1.15.0)`| -|forwardMaterials|Array.|打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数|`微信小程序`| +|forwardMaterials|Array.\|打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数|`微信小程序`| |chatType|number|打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数|`仅微信小程序`| |apiCategory|string|API 类别|`仅微信小程序(2.20.0)`| |showFrom|number|唤起小程序的方式,目前取值固定为 10,表示通过 schema 唤起|`仅字节小程序(1.90.0)`| diff --git a/docs/api/plugins/getLaunchOptionsSync.md b/docs/api/plugins/getLaunchOptionsSync.md index 35a4fcef2228c0b2da2c69f3d6a2608569692d44..c96f854a60d0a301f0de8a675e08f5520843ae63 100644 --- a/docs/api/plugins/getLaunchOptionsSync.md +++ b/docs/api/plugins/getLaunchOptionsSync.md @@ -14,7 +14,7 @@ |scene|Number|启动时的场景值,具体值含义请查看各平台文档说明。钉钉小程序在 IDE 恒为0000,真机不支持。|其他平台均支持,`字节小程序(1.12.0)`| |query|Object|启动时的 query 参数|其他平台均支持,`字节小程序(1.12.0)`| |referrerInfo|Object|来源信息。如果没有则返回 `{}`|其他平台均支持,`字节小程序(1.15.0)`,`飞书小程序不支持`,`钉钉小程序不支持`| -|forwardMaterials|Array.|打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数|`微信小程序`、`QQ小程序`| +|forwardMaterials|Array.\|打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数|`微信小程序`、`QQ小程序`| |entryDataHash|string|群入口信息,通过群应用商店打开、群分享卡片打开的小程序可获得|`仅QQ小程序`| |chatType|number|打开的文件信息数组,只有从聊天素材场景打开(scene为1173)才会携带该参数|`仅微信小程序`| |apiCategory|string|API 类别|`仅微信小程序(2.20.0)`|