如何在 vue 中以编程方式向左滚动 div?

问题描述

我正在尝试将 div 滚动到该 div 中某个元素的位置。 如果将下面的代码添加到按钮,则可以使用,但是如果我尝试以编程方式(动态)使用它,则它不起作用。这与 Fullcalendar 结合使用,应在触发 viewDidMount 时调用。特定视图是 resourceTimelineMonth。

document.getElementsByClassName('fc-scroller').item(1).scrollLeft += document.getElementsByClassName('fc-day-today').item(1).offsetLeft

What the div looks like

Where it needs to scroll to (todays date)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)