fix(Toast): may lose forbid click when has multiple toasts (#5398)

This commit is contained in:
neverland
2019-12-27 10:57:47 +08:00
committed by GitHub
parent e9a9388202
commit cf43e6ee75
3 changed files with 46 additions and 7 deletions
+17
View File
@@ -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');
}
}
}