Skip to content
导航栏

图片控件配置

model字段设置

在相关的model中设置字段类型为json

json
{
  "label": "照片",
  "name": "photo",
  "type": "json",
  "nullable": true
}

图片显示与编辑

table/form定义中设置图片相关的控件属性。

注意:在form里,需要同时设置view/edit属性

json
{
  "图片": {
    "bind": "images",
    "edit": {
      "type": "Upload",
      "compute": "Upload",
      "props": {
        "filetype": "image",
        "$api": {
          "process": "fs.system.Upload"
        }
      }
    },
    "view": {
      "type": "Image",
      "compute": "Download",
      "props": {
        "style": {
          "width": 36,
          "height": 36,
          "borderRadius": "50%"
        }
      }
    }
  }
}