久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  1. <small id='3pgxf'></small><noframes id='3pgxf'>

  2. <tfoot id='3pgxf'></tfoot>
  3. <legend id='3pgxf'><style id='3pgxf'><dir id='3pgxf'><q id='3pgxf'></q></dir></style></legend>

    <i id='3pgxf'><tr id='3pgxf'><dt id='3pgxf'><q id='3pgxf'><span id='3pgxf'><b id='3pgxf'><form id='3pgxf'><ins id='3pgxf'></ins><ul id='3pgxf'></ul><sub id='3pgxf'></sub></form><legend id='3pgxf'></legend><bdo id='3pgxf'><pre id='3pgxf'><center id='3pgxf'></center></pre></bdo></b><th id='3pgxf'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3pgxf'><tfoot id='3pgxf'></tfoot><dl id='3pgxf'><fieldset id='3pgxf'></fieldset></dl></div>
      <bdo id='3pgxf'></bdo><ul id='3pgxf'></ul>

      在 Angular 2/Typescript 中使用 IScroll

      Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)

      • <legend id='61aDn'><style id='61aDn'><dir id='61aDn'><q id='61aDn'></q></dir></style></legend>

      • <i id='61aDn'><tr id='61aDn'><dt id='61aDn'><q id='61aDn'><span id='61aDn'><b id='61aDn'><form id='61aDn'><ins id='61aDn'></ins><ul id='61aDn'></ul><sub id='61aDn'></sub></form><legend id='61aDn'></legend><bdo id='61aDn'><pre id='61aDn'><center id='61aDn'></center></pre></bdo></b><th id='61aDn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='61aDn'><tfoot id='61aDn'></tfoot><dl id='61aDn'><fieldset id='61aDn'></fieldset></dl></div>
        <tfoot id='61aDn'></tfoot>
      • <small id='61aDn'></small><noframes id='61aDn'>

          <tbody id='61aDn'></tbody>
              <bdo id='61aDn'></bdo><ul id='61aDn'></ul>
                本文介紹了在 Angular 2/Typescript 中使用 IScroll的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我想使用一個名為 iscroll 的 Javascript 庫.

                i want to use a Javascript Libary called iscroll.

                到目前為止,我得到了 iscroll.d.ts,現在我想使用它,但我是 typescript 的新手,不知道該怎么做.

                So far i got the iscroll.d.ts and now i want to use it, but iam new at typescript and dont know how to do that.

                我的 iscroll.d.ts 看起來像這樣:

                My iscroll.d.ts looks like this:

                // Generated by typings
                // Source: https://raw.githubusercontent.com/types/typed-iscroll/8524f7c88e521c16462553173c9ea99e9e3d477c/iscroll.d.ts
                declare module 'iscroll' {
                class IScroll {
                  version: string;
                
                  constructor(element: string | HTMLElement, options?: IScroll.IScrollOptions);
                
                  destroy(): void;
                  resetPosition(time: number): boolean;
                  disable(): void;
                  enable(): void;
                  refresh(): void;
                  scrollTo(x: number, y: number, time?: number, easing?: IScroll.IScrollEaseOption): void;
                  scrollBy(x: number, y: number, time?: number, easing?: IScroll.IScrollEaseOption): void;
                  scrollToElement(el: HTMLElement | string, time?: number, offsetX?: number, offsetY?: number, easing?: IScroll.IScrollEaseOption): void;
                  goToPage(x: number, y: number, time?: number, easing?: IScroll.IScrollEaseOption): void;
                  prev(): void;
                  next(): void;
                  zoom(scale: number, x: number, y: number, time?: number): void;
                  refresh(): void;
                  destroy(): void;
                
                  utils: IScroll.IScrollUtils;
                
                  // Events
                  on(type: 'beforeScrollStart' |
                    'scrollCancel' |
                    'scrollStart' |
                    'scrollEnd' |
                    'flick' |
                    'zoomStart' |
                    'zoomEnd', fn: (evt?: any) => void): void;
                  off(type: string, fn?: (evt?: any) => void): void;
                
                }
                
                namespace IScroll {
                  export interface IScrollIndicatorOptions {
                    el?: HTMLElement | string;
                    fade?: boolean;
                    ignoreBoundaries?: boolean;
                    interactive?: boolean;
                    listenX?: boolean;
                    listenY?: boolean;
                    resize?: boolean;
                    shrink?: boolean;
                    speedRatioX?: number;
                    speedRatioY?: number;
                  }
                
                  export interface IScrollKeyBindings {
                    pageUp?: number | string,
                    pageDown: number | string;
                    end: number | string;
                    home: number | string;
                    left: number | string;
                    up: number | string;
                    right: number | string;
                    down: number | string;
                  }
                
                  export interface IScrollOptions {
                
                    indicators?: IScrollIndicatorOptions;
                
                    // Scrollbar
                    scrollbars?: boolean | string;
                    fadeScrollbars?: boolean;
                    interactiveScrollbars?: boolean;
                    resizeScrollbars?: boolean;
                    shrinkScrollbars?: boolean;
                
                    // Zoom
                    zoom?: boolean;
                    zoomMin?: number;
                    zoomMax?: number;
                    startZoom?: number;
                    wheelAction?: string;
                
                    snap?: boolean | string;
                
                    bindToWrapper?: boolean;
                    bounceEasing?: string | IScrollEaseOption;
                    bounceTime?: number;
                    deceleration?: number;
                    mouseWheelSpeed?: number;
                    preventDefaultException?: any;
                    resizePolling?: number;
                    probeType?: number;
                    keyBindings?: boolean | IScrollKeyBindings;
                
                    useTransform?: boolean;
                    useTransition?: boolean;
                    HWCompositing?: boolean;
                    bounce?: boolean;
                    click?: boolean;
                    disableMouse?: boolean;
                    disablePointer?: boolean;
                    disableTouch?: boolean;
                    eventPassthrough?: boolean;
                    freeScroll?: boolean;
                    invertWheelDirection?: boolean;
                    momentum?: boolean;
                    mouseWheel?: boolean;
                    preventDefault?: boolean;
                    tap?: boolean | string;
                
                    scrollX?: number;
                    scrollY?: number;
                    startX?: number;
                    startY?: number;
                
                    // Infinite options
                    infiniteElements: HTMLElement | 'string';
                    cacheSize: number;
                    dataset: (start: number, count: number) => Object[];
                  }
                
                  export interface IScrollEaseOption {
                    style: 'string';
                    fn: Function;
                  }
                  export interface IScrollEaseOptions {
                    quadratic: IScrollEaseOption;
                    circular: IScrollEaseOption;
                    back: IScrollEaseOption;
                    bounce: IScrollEaseOption;
                    elastic: IScrollEaseOption;
                  }
                
                  export interface IScrollUtils {
                    ease: IScrollEaseOptions;
                  }
                }
                
                export = IScroll;
                }
                

                我的 Angular 2 page.ts 看起來像這樣:

                And my Angular 2 page.ts looks like this:

                import {NavController} from "ionic-angular";
                import {AngularFire, AuthProviders, AuthMethods } from "angularfire2";
                import {OnInit, Inject, Component} from "@angular/core";
                import {UserService} from '../../../services/UserService';
                import {AuthPage} from "../home/home";
                import { IScroll } from "iscroll"
                
                @Component({
                    templateUrl: "build/pages/auth/onboarding/onboarding.html",
                    providers: [UserService]
                })
                
                export class OnboardingPage {
                
                    iScroll: IScroll;
                
                    onboardingStep: number = 1;
                

                到目前為止,導入工作正常,但我不知道如何初始化和使用 iscroll.

                The Import works fine so far, i think but i dont know how to init and use iscroll.

                希望你們中的一些人有任何提示如何將其變為現實:)

                Hope some of you got any tips how to bring that to life :)

                推薦答案

                您可以像在普通的舊 javascript 中使用它一樣使用它,不同之處在于您還可以包含類型.

                You use it just like you'd use it in plain old javascript, with the difference that you can also include types.

                例如,javascript:

                For example, javascript:

                let myScroll = new IScroll("#CONTAINER_ID");
                

                打字稿:

                let myScroll: IScroll = new IScroll("#CONTAINER_ID");
                

                (注意 :IScroll 不是必需的,編譯器可以推斷類型,但我添加它是為了說明一點)

                (notice that the : IScroll isn't needed, the compiler can infer the type, but I added it to make a point)

                在你的情況下:

                export class OnboardingPage {
                    iScroll: IScroll;
                
                    constructor() {
                        this.iScroll = new IScroll("#CONTAINER_ID");
                    }
                }
                

                此代碼基于他們的文檔(https://github.com/cubiq/iscroll)但根據您發布的 .d.ts 文件,它需要使用 iscroll 命名空間:

                This code is based on their documentation (https://github.com/cubiq/iscroll) but according to the .d.ts file you posted it requires to use the iscroll namespace:

                let myScroll = new iscroll.IScroll("#CONTAINER_ID");
                

                希望這會有所幫助.

                這篇關于在 Angular 2/Typescript 中使用 IScroll的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數據更新 Observable)
                Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何創建使用 Ionic 組件的自定義指令?)
                Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態元素 - Angular 2 amp;離子2)
                How to reload the ion-page after pop() in ionic2(如何在 ionic2 中的 pop() 之后重新加載離子頁面)
                  <tfoot id='6uFrE'></tfoot>

                  1. <small id='6uFrE'></small><noframes id='6uFrE'>

                        <bdo id='6uFrE'></bdo><ul id='6uFrE'></ul>
                        <i id='6uFrE'><tr id='6uFrE'><dt id='6uFrE'><q id='6uFrE'><span id='6uFrE'><b id='6uFrE'><form id='6uFrE'><ins id='6uFrE'></ins><ul id='6uFrE'></ul><sub id='6uFrE'></sub></form><legend id='6uFrE'></legend><bdo id='6uFrE'><pre id='6uFrE'><center id='6uFrE'></center></pre></bdo></b><th id='6uFrE'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6uFrE'><tfoot id='6uFrE'></tfoot><dl id='6uFrE'><fieldset id='6uFrE'></fieldset></dl></div>

                          <tbody id='6uFrE'></tbody>
                        <legend id='6uFrE'><style id='6uFrE'><dir id='6uFrE'><q id='6uFrE'></q></dir></style></legend>
                          主站蜘蛛池模板: 成人免费网站www网站高清 | 亚洲第一成人影院 | 97国产一区二区精品久久呦 | 免费观看一级毛片视频 | 亚洲色图综合 | 国产观看| 亚洲人在线观看视频 | 56pao在线 | 在线观看国产精品一区二区 | 国产成人在线播放 | 91大片| 日韩综合网 | 一区二区三区不卡视频 | 国产在视频一区二区三区吞精 | 国产精品国产三级国产aⅴ中文 | 国产精品日女人 | 日日干日日操 | 不卡av在线| 久久久久精 | www.av在线| 亚洲国产精品一区 | 精品中文字幕在线观看 | 国产ts人妖系列高潮 | 亚洲精品视频一区二区三区 | 精品视频一区二区 | 国产一区二区三区色淫影院 | 成人九区 | 欧美日韩中文在线 | 91在线中文字幕 | 亚洲高清视频在线观看 | 成人在线观看欧美 | 秋霞a级毛片在线看 | 一区二区精品视频 | 亚洲欧美一区二区三区在线 | 一区二区国产在线观看 | 欧美日韩亚洲二区 | 91在线看片 | 久久精品福利视频 | 黄色操视频 | 国产精品久久久久久久久久三级 | av一区二区三区在线观看 |