feat: 添加 UiTag 组件,更新路由和市场视图,优化用户体验

This commit is contained in:
2025-12-18 23:40:51 +07:00
parent 8b3fec2376
commit 72775b4b37
8 changed files with 137 additions and 38 deletions

View File

@@ -0,0 +1,48 @@
<script lang='ts' setup>
const { type = "primary", size = "medium", round = false } = defineProps<{
type?: "primary" | "secondary" | "tertiary" | "success" | "warning" | "danger";
size?: "small" | "medium" | "large";
round?: boolean;
}>();
</script>
<template>
<div class="ui-tag rounded-md" :class="[type, size, { 'rounded-full': round }]">
<slot />
</div>
</template>
<style lang='css' scoped>
@reference "tailwindcss";
.ui-tag {
@apply px-3 py-1 text-xs;
}
.ui-tag.primary {
@apply bg-(--ion-color-primary) text-white;
}
.ui-tag.secondary {
@apply bg-(--ion-color-secondary) text-white;
}
.ui-tag.tertiary {
@apply bg-(--ion-color-tertiary) text-white;
}
.ui-tag.success {
@apply bg-(--ion-color-success) text-white;
}
.ui-tag.warning {
@apply bg-(--ion-color-warning) text-white;
}
.ui-tag.danger {
@apply bg-(--ion-color-danger) text-white;
}
.ui-tag.small {
@apply text-xs px-2 py-0.5;
}
.ui-tag.medium {
@apply text-sm px-3 py-1;
}
.ui-tag.large {
@apply text-base px-4 py-2;
}
</style>