Files
cz-web/src/components/StatusTag.vue
2026-10-01 17:24:57 +08:00

51 lines
907 B
Vue

<script setup lang="ts">
interface Props {
label: string
variant?: 'primary' | 'success' | 'warning' | 'danger' | 'info'
}
withDefaults(defineProps<Props>(), { variant: 'info' })
</script>
<template>
<span class="status-tag" :class="`status-tag--${variant}`">
{{ label }}
</span>
</template>
<style lang="less" scoped>
.status-tag {
display: inline-block;
padding: 3px 10px;
border-radius: @radius-sm;
font-size: 11px;
line-height: 16px;
white-space: nowrap;
&--primary {
background: @primary-light;
color: @primary-color;
}
&--success {
background: @tag-success-bg;
color: @success-color;
}
&--warning {
background: @tag-warning-bg;
color: @tag-warning-text;
}
&--danger {
background: fade(@danger-color, 12%);
color: @danger-color;
}
&--info {
background: @tag-info-bg;
color: @text-color-secondary;
}
}
</style>