fix(Toast): may lose forbid click when has multiple toasts (#5398)
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
let lockCount = 0;
|
||||
|
||||
export function lockClick(lock: boolean) {
|
||||
if (lock) {
|
||||
if (!lockCount) {
|
||||
document.body.classList.add('van-toast--unclickable');
|
||||
}
|
||||
|
||||
lockCount++;
|
||||
} else {
|
||||
lockCount--;
|
||||
|
||||
if (!lockCount) {
|
||||
document.body.classList.remove('van-toast--unclickable');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user