amis icon indicating copy to clipboard operation
amis copied to clipboard

json组件显示取动态值

Open flute opened this issue 6 years ago • 1 comments

实现场景:

接口返回的数据,使用json组件显示某个字段

存在的问题:

json组件value只能显示写死的固定值,name取值又取不到,要怎么写

当前方案:

{
  "type": "page",
  "initApi": "xxx",
  "body": [
    {
      "type": "each",
      "name": "items", // 能取到值
      "items": {
        ...
      }
    },
    {
      "type": 'json',
      "name": 'items', // 取不到值
      "levelExpand": 9999
    }
  ]
}

flute avatar Aug 20 '20 09:08 flute

组件放form里name才能生效

RickCole21 avatar Aug 20 '20 12:08 RickCole21