@@ -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;
}