Home > SYS_Message > showFollowMouseTip
SYS_Message.showFollowMouseTip() method
This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Show the follow-mouse tip
Signature
typescript
function showFollowMouseTip(tip: string, msTimeout?: number): Promise<void>;1
Parameters
Parameter | Type | Description |
|---|---|---|
tip | string | Tip content |
msTimeout | number | (Optional) Display duration in milliseconds (ms). If not passed in, the tip is displayed continuously until removeFollowMouseTip is called or it is covered by another tip |
Returns
Promise<void>
Remarks
Only one tip can be shown at a time. If a new tip is shown, the previous tip will be automatically removed
Example
javascript
// 1. 限时提示:2000 毫秒后自动消失,无需手动清理
eda.sys_Message.showFollowMouseTip('嘉立创示例_这条提示 2 秒后自动消失', 2000);
console.log('限时鼠标提示已显示,2 秒后自动消失');
// 2. 持续提示:不传时间参数则一直展示,直到被移除或被新提示覆盖
eda.sys_Message.showFollowMouseTip('嘉立创示例_这条提示会一直跟随鼠标');
console.log('持续鼠标提示已显示(新提示覆盖了上一条)');
// 3. 持续提示必须手动收尾,避免遗留(自建自删,保证案例可重复运行)
await new Promise(r => setTimeout(r, 1000));
eda.sys_Message.removeFollowMouseTip();
console.log('持续鼠标提示已手动移除');1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12