utils.js 323 B

1234567891011121314151617181920
  1. const scsUtils = {
  2. // 数组分块
  3. splitArrayIntoSubarrays(arr, groupSize = 5) {
  4. const result = [];
  5. for (let i = 0; i < arr.length; i += groupSize) {
  6. result.push(arr.slice(i, i + groupSize));
  7. }
  8. return result;
  9. },
  10. // 路由跳转
  11. router(path) {
  12. uni.navigateTo({
  13. url: path
  14. })
  15. },
  16. }
  17. export {
  18. scsUtils
  19. }