thinkphp6分页自定义样式
2022-07-28 14:14:58
347
{{single.collect_count}}

使用easyadmin框架
自己写了一个页面和表格,用不了框架的样式了
thinkphp6使用分页的时候使用的是默认的分页样式
在这里插入图片描述
看起来很不美观 使用起来也不方便
这里 给大家写了一个简单的css样式

<style>.list-page {text-align:center;padding: 15px 15px;}.mws-panel-content {background: #eee;}.pagination {margin:0 !important;padding: 10px 10px;box-shadow: 0px 1px 2px 0px #E2E2E2;background: #fff;}.pagination li{border:1px solid #e6e6e6;padding: 3px 8px;display: inline-block;}.pagination .active{background-color: #46A3FF;color: #fff;}.pagination .disabled{color: #aaa;}</style>

在这里插入图片描述
如果需要修改 <<和>>这个变为上一页和下一页
需要到框架中的\vendor\topthink\think-orm\src\paginator\driver\Bootstrap.php
文件下修改

/** * 上一页按钮 * @param string $text * @return string */protected function getPreviousButton(string $text = "«"): string{if ($this->currentPage() <= 1) {return $this->getDisabledTextWrapper($text);}$url = $this->url($this->currentPage() - 1);return $this->getPageLinkWrapper($url, $text);}/** * 下一页按钮 * @param string $text * @return string */protected function getNextButton(string $text = '»'): string{if (!$this->hasMore) {return $this->getDisabledTextWrapper($text);}$url = $this->url($this->currentPage() + 1);return $this->getPageLinkWrapper($url, $text);}

这是上一页和下一页的按钮
string $text = "«"string $text = '»'中的«»分别修改为上一页和下一页或者自己想要的内容即可
在这里插入图片描述

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}