baidu / amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
https://baidu.github.io/amis/
Apache License 2.0
17.33k stars 2.51k forks source link

【分页bug】分页total属性设置为变量表达式不生效 #7332

Closed nabaonan closed 1 year ago

nabaonan commented 1 year ago

描述问题:

给分页组件设置total属性为${total},service中有total变量,并设置为一个定值,但是在分页中没有生效

截图或视频:

image

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的? 官网demo改的

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在 官网版本

  3. 粘贴有问题的完整 amis schema 代码:

    {
    "type": "page",
    
    "body": {
    "type": "service",
    "data": {
      "total": 999
    },
    "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/crud/table",
    "body": [
      {
        "type": "pagination",
    
        "layout": "total,perPage,pager,go",
        "mode": "normal",
    
        "total": "${total}",
        "perPage": 10,
        "maxButtons": 7,
        "showPerPage": true,
        "perPageAvailable": [
          10,
          20,
          50,
          100
        ],
        "showPageInput": true,
        "disabled": false
      }
    ]
    }
    }
  4. 操作步骤 在上层数据域创建一个total的属性,total为999 更改分页组件的total属性为变量引用 ${total} 设置每页10条,无法正常显示分页,正常应该显示100页

github-actions[bot] commented 1 year ago

👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

nabaonan commented 1 year ago

7338