Skip to content

each通过name拿到的数据源,在items中取数据有问题 #12249

@thinkingc

Description

@thinkingc

描述问题:

each通过name拿到的数据源,在items中取数据有问题

截图或视频:

Image

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

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

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

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

{
  "type": "page",
  "data": {
    "arr": [
      "FP-2234123",
      "FP-2234",
      "FP-2234",
      "FP-2234",
      "FP-2234",
      "FP-2234",
      "FP-2234",
      "FP-2234",
      "FP-2234",
      "FP-2234",
      "FP-2234",
      "FP-2234",
    ]
  },
  "body": {
    "type": "form",
    "body": [
      {
        "type": "tpl",
        "tpl": "节点-${arr.length}"
      },
      {
        "type": "each",
        "name": "arr",
        "items": [
          {
            "type": "link",
            "href": "${item}",
            "body": "${item}-${arr.length}"
          },
          {
            "type": "tpl",
            "visibleOn": "${(index + 1) < arr.length}",
            "tpl": "、"
          }
        ]
      }
    ]
  }
}
  1. 操作步骤

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions