Get location from window if available

This commit is contained in:
Sam Carlton 2022-04-29 13:58:46 -05:00
parent bd17f443e5
commit a440904384

View file

@ -213,6 +213,11 @@ export default {
return this.$nuxt.$route.path 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 '/' return '/'
} }
} }