baidu / baidu/amis

tabs组件获取内容配置信息失败

Open
#8,538 0 comments 0 reactions 0 assignees View on GitHub
need confirm
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:

佬,请问下选项卡组件是不支持给里面的选项卡内容(如选项卡1)的配置添加自定义属性吗?我用panelBodyCreator方法,传参的值是里面内容(如选项卡1),但是返回的是外层选项卡的配置信息

#### 截图或视频:
![git-isusse](https://github.com/baidu/amis/assets/15856497/92bf7747-4c15-47a1-bf10-06c7546c72d9)

#### 如何复现(请务必完整填写下面内容):

1. 你是如何使用 amis 的?
npm

2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
最新版本
3. 粘贴有问题的完整 `amis schema` 代码:
```
// schema代码为
{
"type": "tabs",
"tabs": [
{
"title": "选项卡1",
"body": [
{
"type": "tpl",
"tpl": "内容1",
"wrapperComponent": "",
"inline": false,
"id": "u:1b22be8e15e0",
"themeCss": {
"baseControlClassName": {
"boxShadow:default": " 0px 0px 0px 0px transparent"
}
}
}
],
"id": "u:5e2dff2907c5",
"unmountOnExit": false,
"isHasAuthority": "1",
"istabTest": "1"
},
{
"title": "选项卡2",
"body": [
{
"type": "tpl",
"tpl": "内容2",
"wrapperComponent": "",
"inline": false,
"id": "u:40d3e3a205d7"
}
],
"id": "u:d2d4eeb8a4a5"
}
],
"id": "u:fb17af280d61"
}

// 代码为
afterResolveJsonSchema={(event) => {
let panel = event.context.info.plugin.panelBodyCreator(
event.context
);
```

4. 操作步骤
选项卡组件 afterResolveJsonSchema方法使用panelBodyCreator获取

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the tabs component's afterResolveJsonSchema flow and the panelBodyCreator call shown in the issue. Reproduce the provided schema through the npm installation and inspect whether the callback receives the outer tabs configuration instead of the selected tab body. Done means custom properties on an individual tab's content can be retrieved correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
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.