index.sjs 590 B

12345678910111213141516171819202122232425
  1. function checkNeedVerticalSpace(count, index, columns) {
  2. if (count % columns === 0) {
  3. return index < count - columns;
  4. } else {
  5. return index < columns * Math.floor(count / columns);
  6. }
  7. }
  8. function checkShowSplitLine(index, count, columns, mode, showDivider) {
  9. if (!showDivider) {
  10. return false;
  11. }
  12. if (index === count - 1) {
  13. return false;
  14. }
  15. if (mode === 'default') {
  16. if ((index + 1) % columns === 0) {
  17. return false;
  18. }
  19. }
  20. return true;
  21. }
  22. export default {
  23. checkNeedVerticalSpace: checkNeedVerticalSpace,
  24. checkShowSplitLine: checkShowSplitLine
  25. };