From 02a4713375e28aae386d3e2e05289623ee3fb0ba Mon Sep 17 00:00:00 2001 From: ULIVZ <472590061@qq.com> Date: Fri, 10 Aug 2018 00:22:19 +0800 Subject: [PATCH] fix: navbar's regression - siteName null check --- lib/default-theme/Navbar.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/default-theme/Navbar.vue b/lib/default-theme/Navbar.vue index 6ad9bb2098..12795665b7 100644 --- a/lib/default-theme/Navbar.vue +++ b/lib/default-theme/Navbar.vue @@ -58,7 +58,8 @@ export default { if (document.documentElement.clientWidth < MOBILE_DESKTOP_BREAKPOINT) { this.linksWrapMaxWidth = null } else { - this.linksWrapMaxWidth = this.$el.offsetWidth - NAVBAR_VERTICAL_PADDING - this.$refs.siteName.offsetWidth + this.linksWrapMaxWidth = this.$el.offsetWidth - NAVBAR_VERTICAL_PADDING - + (this.$refs.siteName && this.$refs.siteName.offsetWidth || 0) } } handleLinksWrapWidth()