(obj)
| 2794 | |
| 2795 | // 自定义的 stringify 函数,将 [ ] 内的元素从默认的 换行显示 格式化为 一行显示,用于显示自定义翻页规则等给用户看的场景 |
| 2796 | function customStringify(obj) { |
| 2797 | return JSON.stringify(obj, null, 4) |
| 2798 | .replace(/(: \[)([\s\S]*?)(\],?\n)/g, (match, p1, p2, p3) => { |
| 2799 | return p1 + p2.replace(/\n/g, '').replace(/\s{4}/g, '') + p3; |
| 2800 | }); |
| 2801 | } |
| 2802 | |
| 2803 | // 显示页码 |
| 2804 | function pageNumber(type) { |