首页 文章

离子以编程方式显示离子复原

提问于
浏览
1

我想以编程方式显示离子复习器 . 例如,在第一页上加载我加载数据并想要显示离子复习器 . 我没有找到任何功能只有_beginRefresh . 此函数将触发刷新,但不会在刷新元素上设置样式属性TOP . 因此它隐藏在净资产值背后 .

目前我已经创建了一个肮脏的解决方法 .

let scrollcontent = document.getElementsByClassName('ion-page')[0].getElementsByTagName('ion-content')[0].getElementsByClassName('scroll-content')[0]
let rect = scrollcontent.getBoundingClientRect()
document.getElementById('refresher').style.top = rect.top.toString() + 'px'
this.myRefresher._beginRefresh()

我想知道是否有更好的方法 . 谢谢

1 回答

  • 0

    好的,我找到了更好的方法......

    @ViewChild(Content) ContentDashboard: Content;
    this.RefresherDashboard._top = this.ContentDashboard.contentTop.toString() + 'px'
    this.RefresherDashboard._beginRefresh()
    

相关问题