This repository has been archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a square filter count to filter button and tab
- Loading branch information
Showing
4 changed files
with
67 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<VIcon v-if="showIcon" :icon-path="filterIcon" /> | ||
<p | ||
v-else | ||
class="flex h-6 w-6 items-center justify-center bg-dark-charcoal-10" | ||
:class="{ 'bg-dark-charcoal-10 group-hover:bg-dark-charcoal-20': pressed }" | ||
> | ||
{{ appliedFilterCount }} | ||
</p> | ||
</template> | ||
<script lang="ts"> | ||
import { computed, defineComponent } from "@nuxtjs/composition-api" | ||
import VIcon from "~/components/VIcon/VIcon.vue" | ||
import filterIcon from "~/assets/icons/filter.svg" | ||
export default defineComponent({ | ||
name: "VFilterIconOrCounter", | ||
components: { VIcon }, | ||
props: { | ||
appliedFilterCount: { | ||
type: Number, | ||
default: 0, | ||
}, | ||
pressed: { | ||
type: Boolean, | ||
default: false, | ||
}, | ||
}, | ||
setup(props) { | ||
const showIcon = computed(() => props.appliedFilterCount === 0) | ||
return { | ||
showIcon, | ||
filterIcon, | ||
} | ||
}, | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters