classMethod

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-07-26 15:08:21 +07:00
parent 974b64bb80
commit fbcaff4b2b

View file

@ -179,6 +179,24 @@ function selectedDate() {
);
}
function classColorMethod(val: string) {
switch (val) {
case "GET":
return "blue";
case "PUT":
return "warning";
case "POST":
return "primary";
case "PATCH":
return "teal-12";
case "DELETE":
return "red";
default:
break;
}
}
onMounted(() => {
systemName.value = route.query.system as string;
});
@ -299,7 +317,7 @@ onMounted(() => {
</div>
<div v-else-if="col.name === 'method'">
<q-badge
text-color="blue"
:text-color="classColorMethod(col.value)"
style="background-color: #f0ecec"
>{{ col.value ?? "-" }}</q-badge
>