diff options
author | 2023-05-28 23:13:24 +0200 | |
---|---|---|
committer | 2023-05-28 23:29:14 +0200 | |
commit | 33c9b6643f58a6930043f460d5bfdca4bc1f7222 (patch) | |
tree | f313935e30f7b90ea16e564e7171e2e72319ce29 /src/components/FavoriteButton.vue | |
parent | 4d2b037dbe4e78aa90a4a6d9c7315dcf0a51fed9 (diff) | |
download | it-tools-33c9b6643f58a6930043f460d5bfdca4bc1f7222.tar.gz it-tools-33c9b6643f58a6930043f460d5bfdca4bc1f7222.tar.zst it-tools-33c9b6643f58a6930043f460d5bfdca4bc1f7222.zip |
chore(lint): switched to a better lint config
Diffstat (limited to 'src/components/FavoriteButton.vue')
-rw-r--r-- | src/components/FavoriteButton.vue | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/components/FavoriteButton.vue b/src/components/FavoriteButton.vue index 60b2a2b..16df18a 100644 --- a/src/components/FavoriteButton.vue +++ b/src/components/FavoriteButton.vue @@ -1,29 +1,13 @@ -<template> - <n-tooltip trigger="hover"> - <template #trigger> - <c-button - variant="text" - circle - :type="buttonType" - :style="{ opacity: isFavorite ? 1 : 0.2 }" - @click="toggleFavorite" - > - <n-icon :component="FavoriteFilled" /> - </c-button> - </template> - {{ isFavorite ? 'Remove from favorites' : 'Add to favorites' }} - </n-tooltip> -</template> - <script setup lang="ts"> import { FavoriteFilled } from '@vicons/material'; +import { computed, toRefs } from 'vue'; import { useToolStore } from '@/tools/tools.store'; import type { Tool } from '@/tools/tools.types'; -import { computed, toRefs } from 'vue'; + +const props = defineProps<{ tool: Tool }>(); const toolStore = useToolStore(); -const props = defineProps<{ tool: Tool }>(); const { tool } = toRefs(props); const isFavorite = computed(() => toolStore.isToolFavorite({ tool })); @@ -40,3 +24,20 @@ function toggleFavorite(event: MouseEvent) { toolStore.addToolToFavorites({ tool }); } </script> + +<template> + <n-tooltip trigger="hover"> + <template #trigger> + <c-button + variant="text" + circle + :type="buttonType" + :style="{ opacity: isFavorite ? 1 : 0.2 }" + @click="toggleFavorite" + > + <n-icon :component="FavoriteFilled" /> + </c-button> + </template> + {{ isFavorite ? 'Remove from favorites' : 'Add to favorites' }} + </n-tooltip> +</template> |