diff --git a/.changeset/flat-birds-play.md b/.changeset/flat-birds-play.md new file mode 100644 index 000000000..e8d228156 --- /dev/null +++ b/.changeset/flat-birds-play.md @@ -0,0 +1,5 @@ +--- +"druxt-menu": patch +--- + +feat(#679): update menu items when logged in on static generated site diff --git a/packages/menu/src/components/DruxtMenu.vue b/packages/menu/src/components/DruxtMenu.vue index b17c764aa..fce0aa976 100644 --- a/packages/menu/src/components/DruxtMenu.vue +++ b/packages/menu/src/components/DruxtMenu.vue @@ -219,6 +219,14 @@ export default { }, }, + mounted() { + // If logged in and statically generated, re-fetch the menu. + if (this?.$auth?.loggedIn && this?.$store?.app?.context?.isStatic) { + const settings = this.$options.druxt.settings(this, this.component.settings) + this.$options.druxt.fetchData.call(this, settings) + } + }, + methods: { /** * Recursively gets required menu items from the Vuex store.