mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2026-07-23 10:05:42 +08:00
27 lines
581 B
TypeScript
27 lines
581 B
TypeScript
export const display = (fuc: boolean | Function | undefined, row: any) => {
|
|
if (typeof fuc === 'function') {
|
|
return fuc(row);
|
|
}
|
|
if (typeof fuc === 'boolean') {
|
|
return fuc;
|
|
}
|
|
return true;
|
|
};
|
|
|
|
export const disabled = (fuc: boolean | Function | undefined, row: any) => {
|
|
if (typeof fuc === 'function') {
|
|
return fuc(row);
|
|
}
|
|
if (typeof fuc === 'boolean') {
|
|
return fuc;
|
|
}
|
|
return false;
|
|
};
|
|
|
|
export const formatActionText = (fuc: string | Function | undefined, row: any) => {
|
|
if (typeof fuc === 'function') {
|
|
return fuc(row);
|
|
}
|
|
return fuc;
|
|
};
|