UNPKG

tav-ui

Version:
21 lines (18 loc) 638 B
import { unref } from 'vue'; import { isFunction } from '../../../../utils/is2.mjs'; function useTableStyle(propsRef, prefixCls) { function getRowClassName(record, index) { const { striped, rowClassName } = unref(propsRef); const classNames = []; if (striped) { classNames.push((index || 0) % 2 === 1 ? `${prefixCls}-row__striped` : ""); } if (rowClassName && isFunction(rowClassName)) { classNames.push(rowClassName(record, index)); } return classNames.filter((cls) => !!cls).join(" "); } return { getRowClassName }; } export { useTableStyle }; //# sourceMappingURL=useTableStyle2.mjs.map