Use LayUI to implement front-end paging function

Release: 2020-06-17 16:49:16
forward
3981 people have browsed it

Use LayUI to implement front-end paging function

1. Introduction to LayUI

Layui is a domestic front-end UI framework written using its own module specifications, following the writing and organizational form of native HTML/CSS/JS. The threshold is extremely low and you can use it right out of the box. Built-in UI framework with some common elements and components.

The download address is http://www.layui.com/, and you can import it into the project after downloading.

 
Copy after login

2. Introduction to LayPage parameters

aypage is a built-in encapsulated object that can be called directly when paging. There are mainly the following parameters here for Configure the key-value pair set of the layout page:

##pages Required Number curr ##default String Control paging skin 1 Total page value Previous page next Nextpage

Key

Default value

Type

Description

##cont

Required

String/Object

##Container. The value can be passed in element id or native DOM or jquery object

##Number of pages

##1

Number

Current page.

##groups

##5

Number

The number of consecutive pages.

##skin

##first

Number/String/ Boolean

is used to control the home page. first: false, it means not to display the homepage items

last

Number/String/Boolean

is used for control last page. last: false, it means that the last page item is not displayed

prev

##String/Boolean

is used for control One page. If it is not displayed, set false

String/Boolean

用于控制下一页。若不显示,设置false即可

jump

核心参数

Function

触发分页后的回调,函数返回两个参数。
obj是一个object类型。包括了分页的所有配置信息。
first一个Boolean类,检测页面是否初始加载。非常有用,可避免无限刷新。

三、分页实现

在前端展示页面,代码如下:

Copy after login

分页效果如下:

Use LayUI to implement front-end paging function

更多layui知识请关注PHP中文网layui教程栏目

The above is the detailed content of Use LayUI to implement front-end paging function. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!