Skip to content

Tag doesn't show icon when slot is used instead of "value" attribute #1993

Closed
@sid-6581

Description

@sid-6581

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primevue/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=110

Current behavior
When specifying an icon for Tag using the icon attribute and using the slot for the text instead of the value attribute, the icon is not shown.

Expected behavior
The icon should be shown whether the value attribute or the slot is used.

What is the motivation / use case for changing the behavior?
It's often much more convenient to use the slot than the attribute, since the tag is often used for information that is assembled from multiple parts. For instance, a warning tag with the text "X of Y items completed" would be more easily expressed with <Tag severity="warning" icon="pi pi-exclamation-triangle">{{ X }} of {{ Y }} completed</Tag> than using an interpolated string in the value attribute.

Please tell us about your environment:

  • Vue version: 3.2.26

  • PrimeVue version: 3.10

  • Browser: all

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not workingvue2-portable

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions