alibaba / alibaba/lowcode-engine

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

Open
#766 1 comment 0 reactions 0 assignees View on GitHub
enhancement help wanted
Dominant language
TypeScript
Stars
15.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

## 简介

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

## 示例

### 字符串

- schema

```json
{
"componentName": "Slot",
"params": ["p1", "p2"]
}
```

- compile

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

### 字符串数组

- schema

```json
{
"componentName": "Slot",
"params": [["name", "age"], "p2"]
}
```

- compile

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

### 对象

- schema

```json
{
"componentName": "Slot",
"params": [{ "name": "n", "age": "a" }, "p2"]
}
```

- compile

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the JSSchema Slot handling and its compilation entry point, then find any existing tests for slot parameters. Use the three examples in the issue as expected cases: plain parameters must continue to work, while array and object parameter forms produce the shown destructuring syntax.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.