amis icon indicating copy to clipboard operation
amis copied to clipboard

1.1.6 版本 将 form persistData 的数据类型从 boolean 变成 string 后导致 mobx 报错

Open hellozqy opened this issue 5 years ago • 2 comments

描述问题:

1.1.6 版本 将 form persistData 的数据类型从 boolean 变成 string 后,如果之前使用过 persistData 属性且按照当时版本的文档设置为 true 或者 false 的 boolean 类型(在代码中不带双引号),那么就会导致啊 mobx 报 这样一个错误! Error: [mobx-state-tree] Error while converting true to string: value true is not assignable to type: string (Value is not a string).

核心问题: 对于这样的改动是否在改动时考虑兼容过去版本可能性,例如将 persistData 类型设置为 boolean|string 或者提供一个更为友好且完善的提示或者 break changeLog

截图或视频:

可以的话,尽可能提供截图或视频来补充描述你的问题...

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

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

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

{
  "type": "page",
  "body": {
    "type": "form",
    "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/form/saveForm",
    "preventEnterSubmit": true,
    "persistData": true
    "controls": [
      {
        "type": "text",
        "name": "name",
        "label": "姓名:"
      },
      {
        "name": "email",
        "type": "email",
        "label": "邮箱:"
      }
    ]
  }
}
  1. 操作步骤 请简单描述一下复现的操作步骤...

hellozqy avatar May 16 '21 06:05 hellozqy

image 类似问题,之前引用sdk,现在改为引用npm amis react形式,配置好后mobx类型校验报错,不知道有没有类似sdk中的实现方式去屏蔽mobx类型校验

hotmaycold avatar Jun 03 '21 11:06 hotmaycold

应该是修了

nwind avatar Sep 20 '21 02:09 nwind