【问题标题】:ionic 3: click button smooth to top (When the scroll is not complete)ionic 3:单击按钮平滑到顶部(滚动未完成时)
【发布时间】:2018-07-17 05:13:01
【问题描述】:

http://ionicframework.com/docs/api/components/content/Content/

在这个链接中写关于scrolltotop。此语法必须完成滚动才能工作。但我想滚动单击按钮以平滑到顶部(不使用主题标签)。谁知道呢?你能帮帮我吗?

【问题讨论】:

    标签: cordova ionic3


    【解决方案1】:
    import { Component, ViewChild } from '@angular/core';
    import { Content } from 'ionic-angular';
    
    @Component({...}) 
    export class MyPage{
       @ViewChild(Content) content: Content;
    
       scrollToTop() {
       this.content.scrollTo(0, 0, durationInMs)
      }
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-05-14
      • 2018-07-19
      • 1970-01-01
      • 1970-01-01
      • 2021-05-04
      • 1970-01-01
      • 2018-04-28
      • 1970-01-01
      相关资源
      最近更新 更多