it-tools/src/components/ToolCard.vue

56 lines
1,011 B
Vue
Raw Normal View History

2022-04-05 23:23:08 +02:00
<template>
2022-04-15 23:10:47 +02:00
<router-link :to="tool.path">
<n-card class="tool-card">
<n-icon
class="icon"
size="40"
:component="tool.icon"
/>
<n-h3 class="title">
<n-ellipsis>{{ tool.name }}</n-ellipsis>
</n-h3>
<div class="description">
<n-ellipsis
:line-clamp="2"
:tooltip="false"
>
{{ tool.description }}
</n-ellipsis>
</div>
</n-card>
</router-link>
2022-04-05 23:23:08 +02:00
</template>
<script setup lang="ts">
import type { ITool } from '@/tools/Tool';
import { toRefs, defineProps } from 'vue';
const props = defineProps<{ tool: ITool & { category: string } }>()
const { tool } = toRefs(props)
</script>
<style lang="less" scoped>
a {
text-decoration: none;
}
.tool-card {
&:hover {
border-color: var(--n-color-target);
}
2022-04-05 23:23:08 +02:00
.icon {
opacity: 0.7;
}
2022-04-05 23:23:08 +02:00
.title {
margin: 5px 0;
}
2022-04-05 23:23:08 +02:00
.description {
opacity: 0.7;
margin: 5px 0;
}
}
</style>