Skip to content

Commit d894f8f

Browse files
committed
perf: 提高性能
1 parent 8143f1f commit d894f8f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BootstrapBlazor/Components/Message/Message.razor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ export function init(id, invoke) {
88
}
99

1010
export function show(id, msgId) {
11-
const msg = Data.get(id)
1211
const el = document.getElementById(msgId)
1312
if (el === null) {
1413
return
1514
}
1615

16+
const msg = Data.get(id)
1717
let msgItem = msg.items.find(i => i.el.id === msgId)
1818
if (msgItem === void 0) {
1919
msgItem = { el, animationId: null }
2020
msg.items.push(msgItem)
2121
}
2222

2323
if (msgItem.animationId) {
24-
cancelAnimationFrame(msgItem.animationId);
24+
return;
2525
}
2626

2727
const autoHide = el.getAttribute('data-bb-autohide') === 'true';

0 commit comments

Comments
 (0)