amis icon indicating copy to clipboard operation
amis copied to clipboard

actionType 为 clear 或 clear-and-submit 时会带上数据域中的数据

Open biley opened this issue 3 years ago • 2 comments

描述问题:

实际场景是,clear/clear-and-submit 会带上 url 中的参数。为了便于复现,换成了 page 数据域中的数据。 clear 会自动带上数据域中的数据,而 clear-and-submit 会交替出现重置和清空的效果。

截图或视频:

视频中展示了 actionType 为 clear 和 clear-and-submit 的 bug https://user-images.githubusercontent.com/15087577/195262837-2a3ade39-f509-46af-ac35-f1309d79d6ea.mov

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

  1. 你是如何使用 amis 的? npm

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在 在文档中可直接复现

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

{
  "type": "page",
  "body": [
    {
      "type": "crud",
      "api": "/amis/api/mock2/sample",
      "syncLocation": false,
      "columns": [
        {
          "name": "id",
          "label": "ID"
        },
        {
          "name": "grade",
          "label": "CSS grade"
        }
      ],
      "perPageAvailable": [
        10
      ],
      "messages": {},
      "filter": {
        "title": "查询条件",
        "body": [
          {
            "type": "input-text",
            "name": "username",
            "label": "关键字"
          }
        ],
        "actions": [
          {
            "label": "提交",
            "level": "info",
            "size": "md",
            "type": "submit"
          },
          {
            "actionType": "clear",
            "label": "清空",
            "type": "button"
          }
        ]
      }
    }
  ],
  "data": {
    "username": "name"
  }
}
  1. 操作步骤 在官网文档中可直接复现。 actionType 为 clear 会清空并带上数据域中的数据提交,此时表单项中的字段显示为空; actionType 为 clear-and-submit 会 有数据/数据为空 交替出现的情况

biley avatar Oct 12 '22 06:10 biley

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

Please review the labels and make any necessary changes.

github-actions[bot] avatar Oct 12 '22 06:10 github-actions[bot]

俺也一样,版本6.3.0,不过我这边只试了clear-and-submit,多次点击会出现有数据/数据为空 交替出现的情况

wf08314110101 avatar Apr 16 '24 09:04 wf08314110101