From a4409043843c9a9ee12c8c85d1231197c2e2e494 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Fri, 29 Apr 2022 13:58:46 -0500 Subject: [PATCH] Get location from window if available --- components/navbar.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/navbar.vue b/components/navbar.vue index 203f7f4..8e40cbb 100644 --- a/components/navbar.vue +++ b/components/navbar.vue @@ -213,6 +213,11 @@ export default { return this.$nuxt.$route.path } + // If we have a location object, use that. + if ( typeof window !== 'undefined' && typeof window.location === 'object' ) { + return window.location.pathname + } + return '/' } }