diff --git a/packages/primevue/src/rating/Rating.vue b/packages/primevue/src/rating/Rating.vue index 9beeeec9a..84c99954a 100755 --- a/packages/primevue/src/rating/Rating.vue +++ b/packages/primevue/src/rating/Rating.vue @@ -6,7 +6,7 @@ import { focus, getFirstFocusableElement } from '@primeuix/utils/dom'; -import { UniqueComponentId } from '@primevue/core/utils'; import BanIcon from '@primevue/icons/ban'; import StarIcon from '@primevue/icons/star'; import StarFillIcon from '@primevue/icons/starfill'; @@ -43,19 +42,10 @@ export default { emits: ['change', 'focus', 'blur'], data() { return { - d_name: this.name, focusedOptionIndex: -1, isFocusVisibleItem: true }; }, - watch: { - name: function (newValue) { - this.d_name = newValue || UniqueComponentId(); - } - }, - mounted() { - this.d_name = this.d_name || UniqueComponentId(); - }, methods: { getPTOptions(key, value) { return this.ptm(key, { @@ -104,6 +94,11 @@ export default { return value === 1 ? this.$primevue.config.locale.aria.star : this.$primevue.config.locale.aria.stars.replace(/{star}/g, value); } }, + computed: { + namex() { + return this.name || `${this.$attrSelector}_name`; + } + }, components: { StarFillIcon, StarIcon,