diff --git a/config/default.json b/config/default.json index 9f022ea5bb..7f30de811c 100644 --- a/config/default.json +++ b/config/default.json @@ -8,6 +8,9 @@ "host": "localhost:8080/api/catalog", "index": "vue_storefront_catalog" }, + "ssr": { + "executeMixedinAsyncData": true + }, "entities": { "optimize": true, "twoStageCaching": true, diff --git a/core/client-entry.js b/core/client-entry.js index bb361b16aa..34b5d00640 100755 --- a/core/client-entry.js +++ b/core/client-entry.js @@ -25,7 +25,7 @@ router.onReady(() => { return next() } Promise.all(activated.map(c => { // TODO: update me for mixins support - const components = c.mixins ? Array.from(c.mixins) : [] + const components = c.mixins && config.ssr.executeMixedinAsyncData ? Array.from(c.mixins) : [] components.push(c) Promise.all(components.map(SubComponent => { if (SubComponent.asyncData) { diff --git a/core/components/ProductGallery.vue b/core/components/ProductGallery.vue index c53c8ff612..450e1d3838 100644 --- a/core/components/ProductGallery.vue +++ b/core/components/ProductGallery.vue @@ -44,8 +44,9 @@ export default { }, selectVariant () { let option = this.configuration[config.products.galleryVariantsGroupAttribute].id - let index = this.gallery.findIndex(obj => Number(obj.id) === Number(option)) + let index = this.gallery.findIndex(obj => obj.id && Number(obj.id) === Number(option)) this.navigate(index) + this.$forceUpdate() }, toggleZoom () { this.isZoomOpen ? this.isZoomOpen = false : this.isZoomOpen = true @@ -61,6 +62,7 @@ export default { mounted () { setTimeout(() => { this.selectVariant() + this.$forceUpdate() }, 0) } } diff --git a/core/pages/Category.vue b/core/pages/Category.vue index 2dcb0da05e..0faef04223 100644 --- a/core/pages/Category.vue +++ b/core/pages/Category.vue @@ -5,232 +5,14 @@