mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-01 19:47:56 +08:00
feat: 新增tab的tip属性&tab的title为自定义schema时,支持双击编辑
This commit is contained in:
parent
c8fc6e52ff
commit
ee596d4584
@ -866,7 +866,7 @@ order: 68
|
||||
| draggable | `boolean` | false | 是否支持拖拽 |
|
||||
| showTip | `boolean` | false | 是否支持提示 |
|
||||
| showTipClassName | `string` | `'' ` | 提示的类 |
|
||||
| editable | `boolean` | false | 收否可编辑标签名。当 `tabs[x].title` 为 [SchemaNode](../types/schemanode) 时,双击编辑 Tab 的 title 显示空的内容 |
|
||||
| editable | `boolean` | false | 是否可编辑标签名。当 `tabs[x].title` 为 [SchemaNode](../types/schemanode) 时,双击编辑 Tab 的 title 显示空的内容 |
|
||||
| scrollable | `boolean` | true | 是否导航支持内容溢出滚动。(属性废弃) |
|
||||
| sidePosition | `left` / `right` | `left` | `sidebar` 模式下,标签栏位置 |
|
||||
| collapseOnExceed | `number` | | 当 tabs 超出多少个时开始折叠 |
|
||||
|
@ -669,7 +669,7 @@ export class Tabs extends React.Component<TabsProps, any> {
|
||||
{showTip ? (
|
||||
<TooltipWrapper
|
||||
placement="top"
|
||||
tooltip={tip ?? title}
|
||||
tooltip={tip ?? (typeof title === 'string' ? title : '')}
|
||||
trigger="hover"
|
||||
tooltipClassName={showTipClassName}
|
||||
>
|
||||
|
@ -716,7 +716,7 @@ export default class Tabs extends React.Component<TabsProps, TabsState> {
|
||||
const {render} = this.props;
|
||||
return typeof title === 'string' || !title
|
||||
? filter(title, data)
|
||||
: render(`tab-title/${index}`, title, data);
|
||||
: render(`tab-title/${index}`, title, {...data, index});
|
||||
}
|
||||
|
||||
renderToolbar() {
|
||||
|
Loading…
Reference in New Issue
Block a user