1
0
mirror of https://gitee.com/vant-contrib/vant.git synced 2025-04-06 03:57:59 +08:00

chore(cli): scroll to anchor immediately ()

This commit is contained in:
neverland 2020-05-20 17:25:22 +08:00 committed by GitHub
parent dad0160bb4
commit 1f117ab723
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -4,9 +4,7 @@ export function scrollToAnchor(selector) {
const timer = setInterval(() => { const timer = setInterval(() => {
const el = document.querySelector(selector); const el = document.querySelector(selector);
if (el) { if (el) {
el.scrollIntoView({ el.scrollIntoView();
behavior: 'smooth',
});
clearInterval(timer); clearInterval(timer);
} else { } else {
count++; count++;