Skip to content

Commit 0e674bf

Browse files
committed
feat: 增加 show/hide 方法
1 parent 24726c3 commit 0e674bf

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/BootstrapBlazor/Components/Tooltip/Tooltip.razor.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@ export function init(id) {
2020
}
2121
}
2222

23+
export function show(id, delay) {
24+
const tip = Data.get(id)
25+
const { tooltip } = tip;
26+
27+
const handler = setTimeout(() => {
28+
clearTimeout(handler);
29+
tooltip.show();
30+
}, delay || 0);
31+
}
32+
33+
export function hide(id, delay) {
34+
const tip = Data.get(id)
35+
const { tooltip } = tip;
36+
37+
const handler = setTimeout(() => {
38+
clearTimeout(handler);
39+
tooltip.hide();
40+
}, delay || 0);
41+
}
42+
2343
export function dispose(id) {
2444
const tip = Data.get(id)
2545
Data.remove(id)

0 commit comments

Comments
 (0)