diff --git a/src/.vuepress/components/Bar.vue b/src/.vuepress/components/Bar.vue index e82a7698256ff76def9c0de1c0acb712e0d8b5a8..d0ffdbe3f2cbd0c6217d04dff6a25aa47bc1f159 100644 --- a/src/.vuepress/components/Bar.vue +++ b/src/.vuepress/components/Bar.vue @@ -93,7 +93,9 @@ export default { }), computed: { getPath(){ - return window?.location?.origin + window?.location?.pathname; + // we need this condition check because of computed reactive property. + // this.$route.path changes everytime we navigate between pages, so get path will always get's updated. + return window?.location?.origin + (window?.location?.pathname !== this.$route.path ? window?.location?.pathname : this.$route.path); } } } diff --git a/src/.vuepress/components/Cta.vue b/src/.vuepress/components/Cta.vue index 63e6c2333ae35bd09b323d558ecdc53d3bc0b1ea..e11a578ef6cdd199b9f7ec433d18e657b050721c 100755 --- a/src/.vuepress/components/Cta.vue +++ b/src/.vuepress/components/Cta.vue @@ -48,7 +48,9 @@ export default { }), computed: { getPath(){ - return window?.location?.origin + window?.location?.pathname; + // we need this condition check because of computed reactive property. + // this.$route.path changes everytime we navigate between pages, so get path will always get's updated. + return window?.location?.origin + (window?.location?.pathname !== this.$route.path ? window?.location?.pathname : this.$route.path); } } }