pagination 分页

html


  getIndexData() {
        ajax({
            url: domain() + '/qingtuo',
            type: 'get',
            callback: function (data) {
                const list = data.list,
                    total = Math.ceil(data.total / 10);

                __index.createHTML(list);

                //实例化插件
                $('#pagination').pagination({
                    pageCount: total,
                    jump: false,
                    coping: true,
                    isHide: false,
                    homePage: "首页",
                    endPage: "末页",
                    prevCount: "上页",
                    nextCount: "下页",
                    callback: function (api) {
                        ajax({
                            url: domain() + '/qingtuo',
                            data: {
                                page: api.getCurrent()
                            },
                            type: 'get',
                            callback: function (data) {
                                __index.createHTML(data.list);
                            }
                        })
                    }
                })

            }
        });
    },

你可能感兴趣的:(pagination 分页)