amis icon indicating copy to clipboard operation
amis copied to clipboard

表单中使用三个同名combo,并存在visible联动时,隐藏的combo controls如果有值会被提交

Open hotmaycold opened this issue 6 years ago • 2 comments

描述问题:

表单中使用三个同名combo,并存在visible联动时,隐藏的combo controls如果有值会被提交

  1. 粘贴有问题的完整 amis schema 代码:
{
      "type": "combo",
      "name": "content",
      "label": "content",
      "visibleOn": "data.type === 'input_number'",
      "multiLine": true,
      "controls": [
        control('max', '最大', 'number', { required: true }),

      ]
    },
{
      "type": "combo",
      "name": "content",
      "label": "content",
      "visibleOn": "data.type === 'text'",
      "multiLine": true,
      "controls": [
        control('min', '最小', 'number', { required: true }),

      ]
    },
  1. 操作步骤 content.min原来有值,切换联动显示content.max 提交时还是会带上隐藏了的content.min

hotmaycold avatar Sep 28 '20 07:09 hotmaycold

通过显隐联动并不会同步删除掉隐藏的表单项值,你可以配置formula来动态更改隐藏的表单相 或者 api配置请求数据白名单

RickCole21 avatar Sep 28 '20 08:09 RickCole21

通过显隐联动并不会同步删除掉隐藏的表单项值,你可以配置formula来动态更改隐藏的表单相 或者 api配置请求数据白名单

成功了,多谢大佬, formula 好东西啊

hotmaycold avatar Sep 28 '20 08:09 hotmaycold