Skip to content

inputTable 表单在 6.4.0 版本及其以后,无法对“value”:"${1+1}"中的表达式进行解析了 #11842

Open
@guoguo008

Description

@guoguo008

描述问题:

inputTable 表单在 6.4.0 版本及其以后,无法对“value”:"${1+1}"中的表达式进行解析了

截图或视频:

Image

page在初始化 value 的时候用表达式无法正常执行,4.3.0 版本都是可以正常解析的

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

  1. 你是如何使用 amis 的?
    sdknpm其他...
    sdk
  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    6.3.0正常,6.4.0以后都有问题
  3. 粘贴有问题的完整 amis schema 代码:
{
  "type": "form",
  "id": "u:d9422bd7c503",
  "body": [
    {
      "type": "input-table",
      "id": "u:5eef137eee15",
      "name": "table",
      "label": "Table",
      "needConfirm": false,
      "columns": [
        {
          "label": "A",
          "name": "a",
          "id": "u:1e5e9694100f"
        },
        {
          "label": "B",
          "name": "b",
          "id": "u:4db9604b4895",
          "value": "${1==1?'aa':'bb'}",
          "type": "input-text"
        },
        {
          "type": "operation",
          "label": "操作",
          "id": "u:14d636ebd5f6",
          "buttons": [
            {
              "label": "删除",
              "type": "button",
              "level": "link",
              "id": "u:91268ebc8da6"
            }
          ]
        }
      ]
    },
    {
      "type": "button",
      "id": "u:71d94495b162",
      "label": "Table新增一行",
      "target": "table",
      "actionType": "add"
    }
  ],
  "data": {
    "table": [
      {
        "a": "a1",
        "b": "b1"
      },
      {
        "a": "a2",
        "b": "b2"
      },
      {
        "a": "a3",
        "b": ""
      },
      {
        "a": "a3",
        "b": ""
      },
      {
        "a": "a3",
        "b": ""
      }
    ]
  },
  "feat": "Insert",
  "api": "/amis/api/mock2/form/saveForm"
}
  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