zoukankan      html  css  js  c++  java
  • 一维数组分页

    // ==========================================================================一维数组分页
    
        var you = [{
                "categoryId": "51f9da1731d65584ab001f15",
                "categoryName": "母婴",
                "categoryPic": "201410241058583658.png",
                "shopCount": 9
            }, {
                "categoryId": "51f9da1731d65584ab001f16",
                "categoryName": "家居",
                "categoryPic": "201410241057599841.png",
                "shopCount": 12
            }, {
                "categoryId": "51f9da1731d65584ab001f17",
                "categoryName": "美食",
                "categoryPic": "201410241058318991.png",
                "shopCount": 22
            }, {
                "categoryId": "524556e83b9c89db0607e3a6",
                "categoryName": "生活服务",
                "categoryPic": "201410241057355704.png",
                "shopCount": 4
            }, {
                "categoryId": "51f9da1731d65584ab001f17",
                "categoryName": "美食",
                "categoryPic": "201410241058318991.png",
                "shopCount": 22
            }, {
                "categoryId": "524556e83b9c89db0607e3a6",
                "categoryName": "生活服务",
                "categoryPic": "201410241057355704.png",
                "shopCount": 4
            },{
                "categoryId": "51f9da1731d65584ab001f15",
                "categoryName": "母婴",
                "categoryPic": "201410241058583658.png",
                "shopCount": 9
            }, {
                "categoryId": "51f9da1731d65584ab001f16",
                "categoryName": "家居",
                "categoryPic": "201410241057599841.png",
                "shopCount": 12
            }, {
                "categoryId": "51f9da1731d65584ab001f17",
                "categoryName": "美食",
                "categoryPic": "201410241058318991.png",
                "shopCount": 22
            }, {
                "categoryId": "524556e83b9c89db0607e3a6",
                "categoryName": "生活服务",
                "categoryPic": "201410241057355704.png",
                "shopCount": 4
            }, {
                "categoryId": "51f9da1731d65584ab001f17",
                "categoryName": "美食",
                "categoryPic": "201410241058318991.png",
                "shopCount": 22
            }, {
                "categoryId": "524556e83b9c89db0607e3a6",
                "categoryName": "生活服务",
                "categoryPic": "201410241057355704.png",
                "shopCount": 4
            }, {
                "categoryId": "524556e83b9c89db0607e3a6",
                "categoryName": "生活服务",
                "categoryPic": "201410241057355704.png",
                "shopCount": 4
            }];
        var wei = [];
        for(i = 0 ; i < you.length; i++){
            if(i%4 == 0){
                wei.push([]);
            }
            wei[wei.length-1].push(you[i])
        }
        console.log(wei);
  • 相关阅读:
    1.7 Matrix Zero
    1.6 Image Rotation
    Snake Sequence
    安装 Docker
    开源蓝牙协议栈 BTstack学习笔记
    无法从 repo.msys2.org : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds 获取文件
    KEIL生成预编译文件
    Duff's device
    Pyinstaller : unable to find Qt5Core.dll on PATH
    HCI 获取蓝牙厂商信息
  • 原文地址:https://www.cnblogs.com/della/p/5659797.html
Copyright © 2011-2022 走看看