文档

margin

更新时间:

margin表示组件的配置项类型为边距套件,支持定义上下左右四个边的边距数值。

配置项说明

字段名含义类型是否必选备注
name显示名string无。
type类型string无。
default默认值string不填时值为空。
components配置项模块array默认值为["top","bottom","left","right"]。支持的模块包括"top""bottom""left""right"
enableHide配置项对应元素是否能够在画布隐藏boolean默认为false。设置为true时,显示显隐图标按钮,并在当前配置项中增加show字段。

值说明

条件数据类型示例默认值
不配置enableHide,或将enableHide配置为falseobject
{
 "top": 12,
 "right": 24,
 "bottom": 8,
 "left": 24
}
{
 "top": 10,
 "right": 10,
 "bottom": 10,
 "left": 10
}
enableHide配置为trueobject
{
 "top": 12,
 "right": 24,
 "bottom": 8,
 "left": 24,
 "show": true
}
{
 "top": 10,
 "right": 10,
 "bottom": 10,
 "left": 10,
 "show": true
}

配置示例

  • 基础用法(不配置enableHidemargin配置示例
    {
      "margin": {
        "name": "外边距",
        "type": "margin",
        "default": { "top": 10, "left": 10, "right": 10, "bottom": 10 }
      }
    }
  • 允许配置项对应元素隐藏(配置enableHidetruemargin配置示例2
    {
      "margin": {
        "name": "外边距",
        "type": "margin",
        "enableHide": true,
        "default": { "top": 10, "left": 10, "right": 10, "bottom": 10 }
      }
    }
  • 配置项模块插拔(设置componentsmargin配置示例
    {
      "marginComponents": {
        "name": "外边距",
        "type": "margin",
        "enableHide": true,
        "components": ["top", "bottom"]
      }
    }
  • 本页导读 (0)
文档反馈