star显示

This commit is contained in:
kterna
2025-04-08 10:47:59 +08:00
parent 2fc62efd88
commit 1ddb0caf73
@@ -89,6 +89,14 @@ import 'highlight.js/styles/github.css';
}}</a></span>
<span v-else>{{ item.author }}</span>
</template>
<template v-slot:item.stars="{ item }">
<img v-if="item.repo"
:src="`https://img.shields.io/github/stars/${item.repo.split('/').slice(-2).join('/')}.svg`"
:alt="`Stars for ${item.name}`"
style="height: 20px;"
/>
<span v-else></span>
</template>
<template v-slot:item.tags="{ item }">
<span v-if="item.tags.length === 0"></span>
<v-chip v-for="tag in item.tags" :key="tag" color="primary" size="small">{{ tag
@@ -264,6 +272,7 @@ export default {
{ title: '名称', key: 'name', maxWidth: '150px' },
{ title: '描述', key: 'desc', maxWidth: '250px' },
{ title: '作者', key: 'author', maxWidth: '60px' },
{ title: 'Star数', key: 'stars', maxWidth: '100px' },
{ title: '标签', key: 'tags', maxWidth: '60px' },
{ title: '操作', key: 'actions', sortable: false }
],