//列表页——分页 laypage.render({ elem: 'shopList' , count: 50 , limit: 4 , theme: '#daba91' , layout: ['page', 'next'] });该代码应该写在什么标签下
时间: 2024-02-14 11:08:02 浏览: 54
该代码应该写在 `<script>` 标签中。例如:
```html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>分页示例</title>
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/layui/2.5.6/css/layui.min.css">
</head>
<body>
<div id="shopList"></div>
<script src="https://cdn.bootcdn.net/ajax/libs/layui/2.5.6/layui.min.js"></script>
<script>
layui.use(['laypage'], function(){
var laypage = layui.laypage;
laypage.render({
elem: 'shopList'
, count: 50
, limit: 4
, theme: '#daba91'
, layout: ['page', 'next']
});
});
</script>
</body>
</html>
```
阅读全文