动态选择数组字段类型内撇号中的字段



在数组字段中无法读取选择字段选择的函数

我可以调用一个函数来填充选择字段的选择,但是当相同的选择字段位于数组字段中时,我得到类型错误:无法读取未定义/的属性"函数名称">

module.exports = {
  name: 'testtype',
  addFields: [
    {
      name: 'test_dynamic_select',
      type: 'select',
      choices: 'testchoice'
    },
    {
      name: 'insidearray',
      label: 'In Array',
      type: 'array',
      schema: [
        {
          name: 'test_dynamic_select_in_array',
          type: 'select',
          choices: 'testchoice'
        },
      ]
    }
  ],
  construct: function(self, options) {
    self.testchoice = async function(req) {
       var testarray = [
          {
            label: 'London',
            value: 'london'
          },
          {
            label: 'Edinburgh',
            value: 'edinburgh'
          },
          {
            label: 'Manchester',
            value: 'manchester'
          }
        ];
        return testarray;
    }
  }
}

第一个选择作品(名称:"test_dynamic_select"(第二个没有。 (名称:"test_dynamic_select_in_array"(

这在撇号 2.92.1 中已修复。您应该运行"npm update",然后问题应该得到解决。

最新更新