@fe6/water-pro
Version:
An enterprise-class UI design language and Vue-based implementation
24 lines (20 loc) • 570 B
JavaScript
/** @format */
import { unref } from 'vue';
import { isFunction } from '@fe6/shared';
export function useTableStyle(propsRef, prefixCls) {
function getRowClassName(record, index) {
var _unref = unref(propsRef),
striped = _unref.striped,
rowClassName = _unref.rowClassName;
if (!striped) {
return;
}
if (rowClassName && isFunction(rowClassName)) {
return rowClassName(record);
}
return (index || 0) % 2 === 1 ? "".concat(prefixCls, "-row__striped") : '';
}
return {
getRowClassName: getRowClassName
};
}