diff --git a/components/lib/baseicon/BaseIcon.vue b/components/lib/baseicon/BaseIcon.vue index 8cbcdf251..bd92349e3 100644 --- a/components/lib/baseicon/BaseIcon.vue +++ b/components/lib/baseicon/BaseIcon.vue @@ -17,30 +17,24 @@ export default { } }, style: BaseIconStyle, - beforeMount() { - BaseIconStyle.loadStyle({ nonce: this.$config?.csp?.nonce }); - }, methods: { pti() { const isLabelEmpty = ObjectUtils.isEmpty(this.label); return { - class: [ - 'p-icon', - { - 'p-icon-spin': this.spin - } - ], + ...(!this.isUnstyled && { + class: [ + 'p-icon', + { + 'p-icon-spin': this.spin + } + ] + }), role: !isLabelEmpty ? 'img' : undefined, 'aria-label': !isLabelEmpty ? this.label : undefined, 'aria-hidden': isLabelEmpty }; } - }, - computed: { - $config() { - return this.$primevue?.config; - } } };