Skip to content

Commit 2ecc8ea

Browse files
committed
refactor: 更新弹窗脚本
1 parent d5cbb73 commit 2ecc8ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/BootstrapBlazor/Components/Toast/Toast.razor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ export function init(id, invoke, callback) {
3030
invoke.invokeMethodAsync(toast.callback)
3131
})
3232
EventHandler.on(progressElement, 'transitionend', e => {
33-
toast.toast.hide();
33+
if (toast.toast._config.autohide === false) {
34+
toast.toast.hide();
35+
}
3436
});
3537

3638
toast.toast.show();
@@ -42,8 +44,6 @@ export function update(id) {
4244
const autoHide = element.getAttribute('data-bs-autohide') !== 'false';
4345
if (autoHide) {
4446
const delay = parseInt(element.getAttribute('data-bs-delay'));
45-
46-
toast._config.autohide = autoHide;
4747
toast._config.delay = delay;
4848

4949
progressElement.style.width = '100%';

0 commit comments

Comments
 (0)