This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
1
Swap icon when filter is enabled
Post Body
I am a designer that is helping out devs with styling and I am trying to figure out how to switch an icon out when the filter is enabled. I cannot for the life of me figure this out.
<PVButton
v-tooltip.top="'Sort in Ascending Order'"
:text="viewSize === 'small'"
:icon="sortOrder ? 'pi pi-sort-alpha-down iconButton' : 'pi pi-sort-alpha-down-alt iconButton'"
:class="sortOrder > 0 ? activeSortClass : ''"
class="px-0 compactButton"
@click="toggleSortOrder"
/>
So I want to swap pi-sort-alpha-down w/ pi-sort-alpha-down-alt when the filter is active. What am I doing wrong here?
So after fighting to figure it out I was able to work with a dev and this was the solution, my sortOrder wasn't set in the icon line:
:icon="sortOrder > 0 ? 'pi pi-sort-alpha-down sortButton' : 'pi pi-sort-alpha-down-alt sortButton'"
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 8 months ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/vuejs/comme...