Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputFormula 组件 variables 为表达式时,无法获取到 api 返回的数据 #11630

Closed
jinmingpang opened this issue Feb 18, 2025 · 0 comments

Comments

@jinmingpang
Copy link
Contributor

描述问题:

InputFormula 组件 variables属性 为表达式时,无法获取到 api 返回的数据

截图或视频:

Image

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

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

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

最新版

  1. 粘贴有问题的完整 amis schema 代码:
{
  "type": "page",
  "body": {
    "type": "form",
    "debug": true,
    "initApi": {
      "url": "/amis/api/mock2/form/initData",
      "adaptor": "return { data: { vars: [{label: 'a', value: 'a'}] } }"
    },
    "body": [
      {
        "type": "input-formula",
        "name": "formula",
        "label": "公式",
        "evalMode": true,
        "variables": "${vars}"
      }
    ]
  }
}
  1. 操作步骤
  • 复制 json 到文档网站
  • 点击 公式组件右侧图标,变量面板,无数据。(预期应该更更新为 api 返回的数据)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant