Skip to content

Commit

Permalink
Fixed #4692 - BaseIcon: p-icon and p-icon-spin classes in unstyled mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Dec 20, 2023
1 parent 5663e4e commit 4d83ee6
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions components/lib/baseicon/BaseIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
};
</script>

0 comments on commit 4d83ee6

Please sign in to comment.