baidu / baidu/amis

input-table 在执行 addItem 动作的时候 会触发 显示空的"操作"列

Open
#10,271 3 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

我用 sdk 的方式使用 amis,版本是 v6.3.0
利用 amisScoped 对象执行 addItem 的动作,会导致多出来一个空的 操作 列
![image](https://github.com/baidu/amis/assets/164118304/cd788055-f3d9-4bec-b254-2dc0ed628a12)
![image](https://github.com/baidu/amis/assets/164118304/61d2d216-5536-44bf-aa2c-4fa06684e3e8)

请参照如下代码
```



let pageSchema = {
"type": "page",
"data": {
"table": [
{"a": "a1", "b": "b1" },
{ "a": "a2", "b": "b2"}
]
},
body: [
{
"type": "form",
"title": "",
"actions": [],
"body": [
{
"type": "input-table",
"name": "table",
"id": "addItem-input-table",
"columns": [
{
"label": "",
"type": "tpl",
"tpl": "hello $a, let me try $b!"
}
]
}
]
}
]
}

let amis = amisRequire('amis/embed');
window.__amisScoped = amis.embed('#root', pageSchema);


function test1() {
__amisScoped.doAction(
[
{
actionType: 'addItem',
componentId: 'addItem-input-table',
args: {
"item": [
{
"a": "a-noIndex",
"b": "b-noIndex"
}
]
}
}
]
)
}


添加条目


add item

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the provided amis embed example with the input-table and the amisScoped doAction addItem call. Trace how addItem updates input-table columns and identify why an empty 操作 column appears. Done means adding an item no longer creates that empty column, while existing table columns remain unchanged.

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.