How does vue use velocity to implement anchor scrolling?

using velocity scroll animation in vue is not performed and there is no error prompt.

let toElement = document.querySelector(target);
let container = document.querySelector("body");
Velocity(toElement, "scroll", {
    container: container, 
    duration: 500, 
    offset: -60, 
    easing: "ease-out"
});

toElement target element, container container element

Jul.13,2021

take a closer look at the case on the official website. velocity
needs to add key styles to the container.

max-height: 100vh;
overflow-y: scroll;

so you can scroll.

I wrote a demo, hoping to help more people.

https://codepen.io/xwLyc/pen/WgWyjw?editors=0010

Menu