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