Skip to content

Commit

Permalink
Merge pull request #2827 from VisActor/docs/tooltip
Browse files Browse the repository at this point in the history
docs: supplement showTooltip api description
  • Loading branch information
fangsmile authored Nov 14, 2024
2 parents e6acbdc + 25e1b32 commit e468f4b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions docs/assets/api/en/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,8 @@ Show tooltip information prompt box

Note: For the time being, it only supports setting tooltip.renderMode='html' globally, and calling this interface is valid

If you want the tooltip to be hover by the mouse, you need to configure the interface tooltip.disappearDelay so that it does not disappear immediately.

Where the TooltipOptions type is:

```
Expand All @@ -816,6 +818,8 @@ export type TooltipOptions = {
padding?: number[];
arrowMark?: boolean;
};
/** set tooltip's vanishing time */
disappearDelay?: number;
};
```
Expand Down
6 changes: 5 additions & 1 deletion docs/assets/api/zh/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,9 @@ enum HierarchyState {
showTooltip(col: number, row: number, tooltipOptions?: TooltipOptions) => void
```

注意:暂时只支持全局设置了 tooltip.renderMode='html',调用该接口才有效
注意:暂时只支持全局设置了 tooltip.renderMode='html',调用该接口才有效。

如果想要 tooltip 可以被鼠标 hover 上去,需要配置接口 tooltip.disappearDelay,让其不立即消失。

其中 TooltipOptions 类型为:

Expand Down Expand Up @@ -813,6 +815,8 @@ export type TooltipOptions = {
padding?: number[];
arrowMark?: boolean;
};
/** 设置tooltip的消失时间 */
disappearDelay?: number;
};
```
Expand Down
1 change: 1 addition & 0 deletions docs/assets/guide/en/components/tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ The interface showTooltip can actively display tooltip information, which is use
font: 'normal bold normal 14px/1 STKaiti',
arrowMark: true,
},
disappearDelay: 100,
});
}
});
Expand Down
3 changes: 2 additions & 1 deletion docs/assets/guide/zh/components/tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const tableInstance = new VTable.ListTable({
## 通过接口显示 tooltip 自定义信息

接口 showTooltip 可主动显示 tooltip 信息,如下使用方式:(监听单元格 hover 事件,调用接口)
[参考接口说明](https://visactor.io/vtable/option/Methods#showTooltip)
[参考接口说明](../api/Methods#showTooltip)

```
tableInstance.on('mouseenter_cell', (args) => {
Expand All @@ -116,6 +116,7 @@ const tableInstance = new VTable.ListTable({
font: 'normal bold normal 14px/1 STKaiti',
arrowMark: true,
},
disappearDelay: 100,
});
}
});
Expand Down

0 comments on commit e468f4b

Please sign in to comment.