mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
* feat: input-table 增加 rowClassNameExpr 配置 Closes #3672 * 加上 rowClassName
This commit is contained in:
parent
42c658178e
commit
d6f96747e5
@ -591,6 +591,34 @@ order: 54
|
||||
}
|
||||
```
|
||||
|
||||
## 高亮行
|
||||
|
||||
> 1.8.0 及以上版本
|
||||
|
||||
通过 `rowClassNameExpr` 来添加类,比如下面的例子中,如果输入的内容是 `a` 则背景色为绿色`
|
||||
|
||||
```schema: scope="body"
|
||||
{
|
||||
"type": "form",
|
||||
"api": "/api/mock2/form/saveForm",
|
||||
"body": [
|
||||
{
|
||||
"type": "input-table",
|
||||
"name": "table",
|
||||
"addable": true,
|
||||
"editable": true,
|
||||
"rowClassNameExpr": "<%= data.a === 'a' ? 'bg-success' : '' %>",
|
||||
"columns": [
|
||||
{
|
||||
"name": "a",
|
||||
"label": "A"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## 属性表
|
||||
|
||||
| 属性名 | 类型 | 默认值 | 说明 |
|
||||
|
@ -1082,7 +1082,9 @@ export default class FormTable extends React.Component<TableProps, TableState> {
|
||||
prefixRow,
|
||||
formInited,
|
||||
perPage,
|
||||
classnames: cx
|
||||
classnames: cx,
|
||||
rowClassName,
|
||||
rowClassNameExpr
|
||||
} = this.props;
|
||||
|
||||
if (formInited === false) {
|
||||
@ -1131,7 +1133,9 @@ export default class FormTable extends React.Component<TableProps, TableState> {
|
||||
expandConfig,
|
||||
canAccessSuperData,
|
||||
reUseRow: false,
|
||||
offset
|
||||
offset,
|
||||
rowClassName,
|
||||
rowClassNameExpr
|
||||
}
|
||||
)}
|
||||
{(addable && showAddBtn !== false) || showPager ? (
|
||||
|
Loading…
Reference in New Issue
Block a user