吴雨瞳添加了注释

master
wyt 4 months ago
parent e95c2a8abe
commit eae736ea5b

@ -1,28 +1,37 @@
<template>
<!-- 标签项容器使用flex布局设置悬停效果间距和过渡动画 -->
<div class="flex flex-row items-center hover:opacity-50 mr-2 mb-2 cursor-pointer transition-all">
<!-- 标签名称链接跳转到对应标签的文章列表页携带标签ID和名称参数 -->
<router-link
class="bg-ob-deep-900 text-center px-3 py-1 rounded-tl-md rounded-bl-md text-sm"
:to="{ path: '/article-list/' + id, query: { tagName: name } }"
:style="stylingTag()">
class="bg-ob-deep-900 text-center px-3 py-1 rounded-tl-md rounded-bl-md text-sm"
:to="{ path: '/article-list/' + id, query: { tagName: name } }"
:style="stylingTag()">
<em class="opacity-50">#</em>
{{ name }}
</router-link>
<!-- 标签数量显示展示该标签下的文章数量设置右侧圆角 -->
<span
class="bg-ob-deep-900 text-ob-secondary text-center px-2 py-1 rounded-tr-md rounded-br-md text-sm opacity-70"
:style="stylingTag()">
class="bg-ob-deep-900 text-ob-secondary text-center px-2 py-1 rounded-tr-md rounded-br-md text-sm opacity-70"
:style="stylingTag()">
{{ count }}
</span>
</div>
</template>
<script lang="ts">
// Vue
import { defineComponent, toRefs } from 'vue'
//
export default defineComponent({
name: 'ObTagItem',
// ID
props: ['id', 'name', 'count', 'size'],
setup(props) {
// propssize
const tagSize = toRefs(props).size
//
const stylingTag = () => {
if (tagSize.value === 'xs') {
return {
@ -54,13 +63,15 @@ export default defineComponent({
lineHeight: '2rem'
}
}
//
return {
fontSize: '1rem',
lineHeight: '1.5rem'
}
}
// 使
return { stylingTag }
}
})
</script>
</script>
Loading…
Cancel
Save