From 81488be53540676a6f42cc649e032920dfdff3a9 Mon Sep 17 00:00:00 2001 From: liuxiaohang <283700113@qq.com> Date: Sun, 13 Feb 2022 14:55:36 +0800 Subject: [PATCH] update: resolve cookie and ssr render problem --- docs/.vuepress/theme/components/Navbar.vue | 4 +-- .../theme/components/SiderBarBottom.vue | 2 +- docs/.vuepress/theme/layouts/Layout.vue | 26 ++++++++++--------- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/docs/.vuepress/theme/components/Navbar.vue b/docs/.vuepress/theme/components/Navbar.vue index fb6c42cb1..94be3351a 100644 --- a/docs/.vuepress/theme/components/Navbar.vue +++ b/docs/.vuepress/theme/components/Navbar.vue @@ -189,8 +189,8 @@ export default { forbidScroll(this.showMobilePanel) }, switchVersion () { - document.cookie = '__new_version=;expires=-1' - location.replace(location.origin) + document.cookie = encodeURIComponent('__new_version') + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/" + location.replace(location.origin + '?v=' + Date.now()) } }, diff --git a/docs/.vuepress/theme/components/SiderBarBottom.vue b/docs/.vuepress/theme/components/SiderBarBottom.vue index 64512a02b..5e4db2729 100644 --- a/docs/.vuepress/theme/components/SiderBarBottom.vue +++ b/docs/.vuepress/theme/components/SiderBarBottom.vue @@ -83,7 +83,7 @@ computed: { currentConfig() { - return this.siderbarConfig[this.customNavBarKeys[this.navConfig.userNavIndex]]; + return this.siderbarConfig[this.customNavBarKeys[this.navConfig.userNavIndex]] || {}; }, currentQQGroup() { return [...(this.currentConfig.qq_group || [])].reverse(); diff --git a/docs/.vuepress/theme/layouts/Layout.vue b/docs/.vuepress/theme/layouts/Layout.vue index 26a98a722..72b9e1644 100644 --- a/docs/.vuepress/theme/layouts/Layout.vue +++ b/docs/.vuepress/theme/layouts/Layout.vue @@ -15,18 +15,20 @@ @click="toggleSidebar(false)" /> - - - - + + + + + + -- GitLab