JS-分页插件

用于对数据分页显示

Dette scriptet burde ikke installeres direkte. Det er et bibliotek for andre script å inkludere med det nye metadirektivet // @require https://update.greasyfork.org/scripts/465550/1551954/JS-%E5%88%86%E9%A1%B5%E6%8F%92%E4%BB%B6.js

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

Forfatter
WhiteSevs
Versjon
0.0.1.20250312070906
Lagd
05.05.2023
Oppdatert
12.03.2025
Size
24,8 kB
Lisens
I/T

数据分页导航

  • 基本使用
let dataPaging = new DataPaging({
  data: [1, 2, 3, 4, 5, 6, 7, 8, 9], // 数组,里面具体什么值无所谓,需要的是它的长度用来分页
  pageShowDataMaxCount: 5, // 每一页显示的数据条数,如上面的数组共有9个,每页显示5个,会有2页
  pageMaxStep: 3, // 显示出来的按钮数量
  currentPage: 1, // 当前处于的第几个页码
  pageChangeCallBack: function (page) {
    // 当页码切换时发生的回调
    console.log(page);
  },
  /* 上一页按钮 */
  prevBtn: {
    enable: true /* 是否启用 */,
    callBack: function () {} /* 点击事件回调 */,
  },
  /* 下一页按钮 */
  nextBtn: {
    enable: true /* 是否启用 */,
    callBack: function () {},
  },
  /* 第一页按钮 */
  firstBtn: {
    enable: true /* 是否启用 */,
    callBack: function () {},
  },
  /* 最后一页按钮 */
  lastBtn: {
    enable: true /* 是否启用 */,
    callBack: function () {},
  },
});
  • 将分页视图追加到某个元素里
dataPaging.append(element:HTMLElement);
  • 动态修改上面的init的配置,如果当前数据长度改变的话可以使用它
dataPaging.changeConfig(details:Object);