mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-22 07:26:48 +00:00
tag 分页部分提交
This commit is contained in:
14
lib/utils.js
14
lib/utils.js
@@ -105,3 +105,17 @@ export const delay = ms => new Promise(resolve => setTimeout(resolve, ms))
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export const isBrowser = () => typeof window !== 'undefined'
|
||||
|
||||
/**
|
||||
* 获取从第1页到指定页码的文章
|
||||
* @param pageIndex 第几页
|
||||
* @param list 所有文章
|
||||
* @param pageSize 每页文章数量
|
||||
* @returns {*}
|
||||
*/
|
||||
export const getListByPage = function (list, pageIndex, pageSize) {
|
||||
return list.slice(
|
||||
0,
|
||||
pageIndex * pageSize
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user