Skip to content

Commit f9623be

Browse files
committed
feat: 增加 toggle 方法
1 parent 0e674bf commit f9623be

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ export function hide(id, delay) {
4040
}, delay || 0);
4141
}
4242

43+
export function toggle(id, delay) {
44+
const tip = Data.get(id)
45+
const { tooltip } = tip;
46+
47+
const handler = setTimeout(() => {
48+
clearTimeout(handler);
49+
tooltip.toggle();
50+
}, delay || 0);
51+
}
52+
4353
export function dispose(id) {
4454
const tip = Data.get(id)
4555
Data.remove(id)

0 commit comments

Comments
 (0)