2022-08-05 06:03:24 -07:00
|
|
|
<template>
|
2022-12-14 01:04:10 -08:00
|
|
|
<fragment>
|
|
|
|
<el-tag v-if="type === 'danger'" type="danger" size="small" :class="$style['danger']">
|
|
|
|
{{ text }}
|
|
|
|
</el-tag>
|
|
|
|
<el-tag v-else-if="type === 'warning'" size="small" :class="$style['warning']">
|
|
|
|
{{ text }}
|
|
|
|
</el-tag>
|
|
|
|
</fragment>
|
2021-07-22 01:22:17 -07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
export default {
|
2022-12-14 01:04:10 -08:00
|
|
|
props: ['text', 'type'],
|
2021-07-22 01:22:17 -07:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.badge {
|
2022-12-14 01:04:10 -08:00
|
|
|
font-size: 11px;
|
|
|
|
line-height: 18px;
|
|
|
|
max-height: 18px;
|
|
|
|
font-weight: 400;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
padding: 2px 4px;
|
2021-07-22 01:22:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.danger {
|
2022-12-14 01:04:10 -08:00
|
|
|
composes: badge;
|
|
|
|
color: $badge-danger-color;
|
|
|
|
background-color: $badge-danger-background-color;
|
|
|
|
border-color: $badge-danger-border-color;
|
2021-07-22 01:22:17 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
.warning {
|
2022-12-14 01:04:10 -08:00
|
|
|
composes: badge;
|
|
|
|
background-color: $badge-warning-background-color;
|
|
|
|
color: $badge-warning-color;
|
|
|
|
border: none;
|
2021-07-22 01:22:17 -07:00
|
|
|
}
|
2022-08-05 06:03:24 -07:00
|
|
|
</style>
|