alibaba/lowcode-engine

[Feature Request]关于 slot 的功能增强

Open

#766 建立於 2022年7月2日

在 GitHub 查看
 (1 留言) (0 反應) (0 負責人)TypeScript (2,228 fork)batch import
enhancementhelp wanted

倉庫指標

Star
 (12,714 star)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

简介

希望 JSSchema 能够支持插槽参数的的解构,现有的 schema 结构仅能支持插槽的参数提取

示例

字符串

  • schema

    {
      "componentName": "Slot",
      "params": ["p1", "p2"]
    }
    
  • compile

    const slotFn = (p1, p2) => {
      /* ... */
    };
    

字符串数组

  • schema

    {
      "componentName": "Slot",
      "params": [["name", "age"], "p2"]
    }
    
  • compile

    const slotFn = ({ name, age }, p2) => {
      /* ... */
    };
    

对象

  • schema

    {
      "componentName": "Slot",
      "params": [{ "name": "n", "age": "a" }, "p2"]
    }
    
  • compile

    const slotFn = ({ name: n, age: a }, p2) => {
      /* ... */
    };
    

貢獻者指南