mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore(cli): scroll to anchor immediately (#6323)
This commit is contained in:
parent
dad0160bb4
commit
1f117ab723
@ -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++;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user