From c797f944a6c3b6dacaaf84354b5bc125fd947aaa Mon Sep 17 00:00:00 2001 From: mertsincan Date: Fri, 2 Feb 2024 15:47:25 +0000 Subject: [PATCH] Refactor #4953 - For Galleria --- components/lib/galleria/GalleriaContent.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/lib/galleria/GalleriaContent.vue b/components/lib/galleria/GalleriaContent.vue index aa0238c94..27f07cdae 100755 --- a/components/lib/galleria/GalleriaContent.vue +++ b/components/lib/galleria/GalleriaContent.vue @@ -76,13 +76,16 @@ export default { emits: ['activeitem-change', 'mask-hide'], data() { return { - id: this.$attrs.id || UniqueComponentId(), + id: this.$attrs.id, activeIndex: this.$attrs.activeIndex, numVisible: this.$attrs.numVisible, slideShowActive: false }; }, watch: { + '$attrs.id': function (newValue) { + this.id = newValue || UniqueComponentId(); + }, '$attrs.value': function (newVal) { if (newVal && newVal.length < this.numVisible) { this.numVisible = newVal.length; @@ -98,6 +101,9 @@ export default { newVal ? this.startSlideShow() : this.stopSlideShow(); } }, + mounted() { + this.id = this.id || UniqueComponentId(); + }, updated() { this.$emit('activeitem-change', this.activeIndex); },