当前使用版本(必填,否则不予处理)

3.4.1

该问题是如何引起的?(确定最新版也有问题再提!!!)

freemarker中读取com.baomidou.mybatisplus.extension.plugins.pagination.Page对象的pages字段报错,但是读取current没问题。经过查询发现: - pages属于com.baomidou.mybatisplus.core.metadata.IPage - current属于com.baomidou.mybatisplus.extension.plugins.pagination.Page

推测使用Ipage中属性会有问题

重现步骤(如果有就写完整)

在xxx.ftl中:

<script type="text/javascript">

    $(document).ready(function() {
        $('#page').pagination({
            items: 100,
            itemsOnPage: 10,
            currentPage: "${al.current}",
            pages: "${al.pages}",
            cssStyle: 'light-theme'
        })
    }
</script>

上面的al是一个Page对象。

报错信息

2020-12-25 19:28:43 http-nio-26000-exec-1 ERROR [freemarker.runtime] [60] Error executing FreeMarker template
freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:
==> al.pages  [in template "articleList.ftl" at line 54, column 23]

----
Tip: It's the step after the last dot that caused this error, not those before it.

Comment From: foxfire881

我也是这个问题,freemarker中接收不到pages属性,请问你解决了吗?

Comment From: iengchen

我也是这个问题,freemarker中接收不到pages属性,请问你解决了吗?

没有

Comment From: qmdx

https://github.com/baomidou/mybatis-plus/commit/9dc8dc9a5f37acffe232deb7f7aa7046c460f524