【问题标题】:SharePoint Framework web part scrollingSharePoint 框架 Web 部件滚动
【发布时间】:2018-10-22 06:22:13
【问题描述】:

我在使用大型 UI 的 SPFx Web 部件时遇到问题。当用户向下滚动一页并单击更改页面的链接时,似乎无法以编程方式滚动到 Web 部件的顶部。我已经尝试了所有常用的方法,例如 scrollIntoView 到顶部的 div 和 scrollTo ,但似乎没有任何效果。有没有办法在 SPFx Web 部件内滚动?

【问题讨论】:

    标签: web-parts spfx


    【解决方案1】:

    在其他帖子中,有人在 react 中使用了 windows.scrollTo(0,0) 事件并且它有效。您可以放置​​一个按钮或箭头,可以使用此属性在顶部或底部移动。

    componentDidMount() {
    window.scrollTo(0, 0)
    }
    

    Scroll to the top of the page after render in react.js

    【讨论】:

      猜你喜欢
      • 2018-02-13
      • 1970-01-01
      • 2011-06-16
      • 1970-01-01
      • 2012-02-07
      • 1970-01-01
      • 2013-07-25
      • 2022-11-11
      相关资源
      最近更新 更多