React滚动条组件react-custom-scrollbars及自定义回到顶部动画

2021-03-24579次阅读React

React滚动条组件react-custom-scrollbars及自定义回到顶部动画

const scrollbar = useRef(null); // or this.scrollbar = React.createRef(); if you're not using hooks

scrollbar.current.view.scroll({
    top: 0,
    behavior: 'smooth',
 });

React滚动条组件react-custom-scrollbars

上一篇: no such file or directory, scandir '.../node_modules/node-sass/vendor'  下一篇: react-intl实现React组件国际化  

React滚动条组件react-custom-scrollbars及自定义回到顶部动画相关文章