diff options
author | 2022-06-01 23:52:21 +0200 | |
---|---|---|
committer | 2022-06-02 00:11:49 +0200 | |
commit | 11720e6cdefc1da4bdd638415813b609840f8462 (patch) | |
tree | b647d77a2fe3cec6af3b81bf02ceb17e636d80b7 /src/components/MenuIconItem.vue | |
parent | ac89490794ee3c1c033859ffea31a962a13cc96d (diff) | |
download | it-tools-11720e6cdefc1da4bdd638415813b609840f8462.tar.gz it-tools-11720e6cdefc1da4bdd638415813b609840f8462.tar.zst it-tools-11720e6cdefc1da4bdd638415813b609840f8462.zip |
feat(tools): new badge for recently created tools
Diffstat (limited to 'src/components/MenuIconItem.vue')
-rw-r--r-- | src/components/MenuIconItem.vue | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/components/MenuIconItem.vue b/src/components/MenuIconItem.vue new file mode 100644 index 0000000..0909e56 --- /dev/null +++ b/src/components/MenuIconItem.vue @@ -0,0 +1,36 @@ +<template> + <div class="menu-icon-item"> + <n-icon :component="tool.icon" /> + <div v-if="tool.isNew" class="badge"></div> + </div> +</template> + +<script setup lang="ts"> +import type { ITool } from '@/tools/tool'; +import { useThemeVars } from 'naive-ui'; +import { toRefs } from 'vue'; + +const props = defineProps<{ tool: ITool }>(); +const { tool } = toRefs(props); + +const theme = useThemeVars(); +</script> + +<style lang="less" scoped> +.menu-icon-item { + position: relative; + + .badge { + position: absolute; + background-color: v-bind('theme.primaryColor'); + border-radius: 10px; + line-height: 1; + top: 3px; + left: -6px; + font-size: 10px; + + height: 6px; + width: 6px; + } +} +</style> |