diff --git a/components/lib/fieldset/Fieldset.vue b/components/lib/fieldset/Fieldset.vue index 02e811465..f15ffceae 100755 --- a/components/lib/fieldset/Fieldset.vue +++ b/components/lib/fieldset/Fieldset.vue @@ -2,15 +2,15 @@
- {{ legend }} + {{ legend }} -
+
@@ -48,14 +48,21 @@ export default { emits: ['update:collapsed', 'toggle'], data() { return { + id: this.$attrs.id, d_collapsed: this.collapsed }; }, watch: { + '$attrs.id': function (newValue) { + this.id = newValue || UniqueComponentId(); + }, collapsed(newValue) { this.d_collapsed = newValue; } }, + mounted() { + this.id = this.id || UniqueComponentId(); + }, methods: { toggle(event) { this.d_collapsed = !this.d_collapsed; @@ -73,9 +80,6 @@ export default { } }, computed: { - ariaId() { - return UniqueComponentId(); - }, buttonAriaLabel() { return this.toggleButtonProps && this.toggleButtonProps.ariaLabel ? this.toggleButtonProps.ariaLabel : this.legend; }