add solution

9_bonus
valerio 2025-01-26 16:06:26 +01:00
parent 92bba28b4c
commit 9c6f8ff749
1 changed files with 21 additions and 0 deletions

View File

@ -12,6 +12,7 @@
</template>
<script setup>
import {computed} from 'vue';
const props = defineProps({
kuerzel: null,
@ -26,6 +27,26 @@ function emitData() {
emit("deleteEntry", props.id)
}
const Colors = {
EXCELLENT: '#247d37',
GOOD: '#7ba656',
AVERAGE: '#ded147',
POOR: '#dea947',
FAIL: '#de6847',
};
const backgroundColor = computed(() => {
if (props.note <= 1.3)
return Colors.EXCELLENT;
if (props.note <= 2.3)
return Colors.GOOD;
if (props.note <= 3.3)
return Colors.AVERAGE;
if (props.note <= 4.3)
return Colors.POOR;
return Colors.FAIL;
});
</script>
<style></style>