feat: colorize function

This commit is contained in:
opbnq-q
2025-03-10 07:35:24 -07:00
parent 6bf4f1e289
commit ccde027c83
4 changed files with 22 additions and 9 deletions

View File

@@ -64,6 +64,18 @@ const slots = defineSlots();
const createSlotName = (key: any) => key + "Create";
const updateSlotName = (key: any) => key + "Update";
watch(() => props.items, () => {
if (props.colorize) {
const trs = document.querySelectorAll("tr");
props.items.forEach(item => {
const tr = trs[item.Id];
if (tr) {
tr.style.backgroundColor = props.colorize(item);
}
})
}
})
</script>
<template>
@@ -117,7 +129,7 @@ const updateSlotName = (key: any) => key + "Update";
v-if="!props.scheme[key].hidden"
>
<template #body="{ data }">
<p>
<p class="">
{{
viewDate(manyStructsView(
data[key],