druxt-menu 0.19.3 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -220,6 +220,15 @@ export default {
|
|
|
220
220
|
},
|
|
221
221
|
},
|
|
222
222
|
|
|
223
|
+
mounted() {
|
|
224
|
+
// If logged in and statically generated, re-fetch the menu.
|
|
225
|
+
if (this?.$auth?.loggedIn && this?.$store?.app?.context?.isStatic) {
|
|
226
|
+
this.$store.commit('druxtMenu/flushEntities', { prefix: this.lang })
|
|
227
|
+
const settings = this.$options.druxt.settings(this, this.component.settings)
|
|
228
|
+
this.$options.druxt.fetchData.call(this, settings)
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
|
|
223
232
|
methods: {
|
|
224
233
|
/**
|
|
225
234
|
* Recursively gets required menu items from the Vuex store.
|
package/dist/druxt-menu.esm.js
CHANGED
|
@@ -167,6 +167,12 @@ const DruxtMenuStore = ({ store }) => {
|
|
|
167
167
|
const entity = entities[index];
|
|
168
168
|
Vue.set(state.entities[prefix], entity.id, entity);
|
|
169
169
|
}
|
|
170
|
+
},
|
|
171
|
+
flushEntities(state, { prefix }) {
|
|
172
|
+
if (!prefix || typeof state.entities !== "object")
|
|
173
|
+
Vue.set(state, "entities", {});
|
|
174
|
+
if (prefix)
|
|
175
|
+
Vue.set(state.entities, prefix, {});
|
|
170
176
|
}
|
|
171
177
|
},
|
|
172
178
|
actions: {
|
package/dist/druxt-menu.ssr.js
CHANGED
|
@@ -175,6 +175,12 @@ const DruxtMenuStore = ({ store }) => {
|
|
|
175
175
|
const entity = entities[index];
|
|
176
176
|
Vue__default["default"].set(state.entities[prefix], entity.id, entity);
|
|
177
177
|
}
|
|
178
|
+
},
|
|
179
|
+
flushEntities(state, { prefix }) {
|
|
180
|
+
if (!prefix || typeof state.entities !== "object")
|
|
181
|
+
Vue__default["default"].set(state, "entities", {});
|
|
182
|
+
if (prefix)
|
|
183
|
+
Vue__default["default"].set(state.entities, prefix, {});
|
|
178
184
|
}
|
|
179
185
|
},
|
|
180
186
|
actions: {
|