KNXCloud / lowcode-engine-vue

Lowcode engine renderer and simulator for vue
MIT License
356 stars 76 forks source link

请问 isContainer 默认不显示子元素怎么处理?手动加了个自定义内容插槽,才会显示 #85

Closed PineSongCN closed 10 months ago

PineSongCN commented 10 months ago

配置如下

{
      "componentName": "UniCol",
      "title": "布局-列",
      "category": "数据展示",
      "npm": {
        "package": "uni-lib",
        "version": "1.0.0",
        "exportName": "TnCol",
        "destructuring": true
      },
      "props": [
        {
          "name": "children",
          "title": { "label": "自定义内容" },
          "propType": "node"
        },
        {
          "name": "float",
          "title": { "label": "是否浮动", "tip": "float | 是否浮动" },
          "propType": "bool",
          "setter": ["BoolSetter", "VariableSetter"],
          "defaultValue": true
        },
        {
          "name": "span",
          "title": { "label": "列数", "tip": "span | 栅格占据的列数" },
          "propType": "number",
          "setter": {
            "componentName": "NumberSetter",
            "props": { "min": 1, "max": 24 }
          },
          "defaultValue": 24
        },
        {
          "name": "offset",
          "title": {
            "label": "间隔格数",
            "tip": "offset | 栅格左侧的间隔格数"
          },
          "propType": "number",
          "setter": {
            "componentName": "NumberSetter",
            "props": { "min": -1, "max": 24 }
          },
          "defaultValue": -1
        },
        {
          "name": "pull",
          "title": {
            "label": "向左移动格数",
            "tip": "pull | 栅格向左移动格数"
          },
          "propType": "number",
          "setter": {
            "componentName": "NumberSetter",
            "props": { "min": -1, "max": 24 }
          },
          "defaultValue": -1
        },
        {
          "name": "push",
          "title": {
            "label": "向右移动格数",
            "tip": "push | 栅格向右移动格数"
          },
          "propType": "number",
          "setter": {
            "componentName": "NumberSetter",
            "props": { "min": -1, "max": 24 }
          },
          "defaultValue": -1
        }
      ],
      "configure": {
        "components": {
          "isContainer": true,
          "nestingRule": { "parentWhitelist": ["UniRow"] }
        },
        "supports": {
          "style": true,
          "events": [
            {
              "name": "onClick",
              "template": "onClick(e){\n// 点击事件\nconsole.log('onClick', e);}"
            }
          ]
        }
      }
    }

操作视频:

https://github.com/KNXCloud/lowcode-engine-vue/assets/39976617/33e1cc25-284b-4dfd-97c7-b2ac2a6e838c