feat: 添加 UiTag 组件,更新路由和市场视图,优化用户体验
This commit is contained in:
48
src/components/ui/tag/index.vue
Normal file
48
src/components/ui/tag/index.vue
Normal 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>
|
||||
Reference in New Issue
Block a user