Fixed #3558 - Unique values created in components are set incorrectly.

This commit is contained in:
mertsincan 2023-01-19 04:01:03 +00:00
parent 86a34cde87
commit 2da56f7ed9
18 changed files with 120 additions and 52 deletions

View file

@ -77,9 +77,18 @@ export default {
},
data() {
return {
name: this.$attrs.name,
focusedOptionIndex: -1
};
},
watch: {
'$attrs.name': function (newValue) {
this.name = newValue || UniqueComponentId();
}
},
mounted() {
this.name = this.name || UniqueComponentId();
},
methods: {
onOptionClick(event, value) {
if (!this.readonly && !this.disabled) {
@ -133,9 +142,6 @@ export default {
},
offIconClass() {
return ['p-rating-icon', this.offIcon];
},
name() {
return this.$attrs.name || UniqueComponentId();
}
}
};