jdcProject_front/src/pages/demo/vxe-table/tsx/RoleColumnSlots.tsx

10 lines
353 B
TypeScript
Raw Normal View History

2024-11-18 19:40:44 +08:00
import type { VxeColumnPropTypes } from "vxe-table/types/column"
2024-12-03 14:51:09 +08:00
export const RoleColumnSlots: VxeColumnPropTypes.Slots = {
default: ({ row, column }) => {
const cellValue = row[column.field]
const type = cellValue === "admin" ? "primary" : "warning"
2022-10-25 18:36:41 +08:00
return [<span class={`el-tag el-tag--${type} el-tag--plain`}>{cellValue}</span>]
}
}