@addapptables/perfect-scrollbar 中文文档教程

发布于 4年前 浏览 6 项目主页 更新于 3年前

ADDAPPTABLES Perfect-scrollbar

滚动浏览器的实用程序

Getting Started

首先,让我们通过 npm 安装包:

选择与您的 Angular 版本相对应的版本:

Angular@addapptables/perfect-scrollbar
82.x
71.x
npm i @addapptables/perfect-scrollbar perfect-scrollbar --S

How to use

中导入 AddapptablePerfectScrollbarModule

   import { AddapptablePerfectScrollbarModule } from '@addapptables/perfect-scrollbar';
    @NgModule({
        imports: [AddapptablePerfectScrollbarModule]
    })
    export class AddapptableModule { }
    .menu-scroll-container{
        position: relative; //this property is important
    }
<div addapptablesPerfectScrollbar class="menu-scroll-container">
    ...large content
</div>

在您的模块选项

export interface Options {
    handlers?: string[];
    maxScrollbarLength?: number;
    minScrollbarLength?: number;
    scrollingThreshold?: number;
    scrollXMarginOffset?: number;
    scrollYMarginOffset?: number;
    suppressScrollX?: boolean;
    suppressScrollY?: boolean;
    swipeEasing?: boolean;
    useBothWheelAxes?: boolean;
    wheelPropagation?: boolean;
    wheelSpeed?: number;
  }
<div addapptablesPerfectScrollbar [perfectScrollOptions]="{ wheelPropagation: true }" class="menu-scroll-container">
    ...large content
</div>

ADDAPPTABLES Perfect-scrollbar

Utility for scroll browser

Getting Started

To get started, let's install the package through npm:

Choose the version corresponding to your Angular version:

Angular@addapptables/perfect-scrollbar
82.x
71.x
npm i @addapptables/perfect-scrollbar perfect-scrollbar --S

How to use

Import AddapptablePerfectScrollbarModule in your module

   import { AddapptablePerfectScrollbarModule } from '@addapptables/perfect-scrollbar';
    @NgModule({
        imports: [AddapptablePerfectScrollbarModule]
    })
    export class AddapptableModule { }
    .menu-scroll-container{
        position: relative; //this property is important
    }
<div addapptablesPerfectScrollbar class="menu-scroll-container">
    ...large content
</div>

Options

export interface Options {
    handlers?: string[];
    maxScrollbarLength?: number;
    minScrollbarLength?: number;
    scrollingThreshold?: number;
    scrollXMarginOffset?: number;
    scrollYMarginOffset?: number;
    suppressScrollX?: boolean;
    suppressScrollY?: boolean;
    swipeEasing?: boolean;
    useBothWheelAxes?: boolean;
    wheelPropagation?: boolean;
    wheelSpeed?: number;
  }
<div addapptablesPerfectScrollbar [perfectScrollOptions]="{ wheelPropagation: true }" class="menu-scroll-container">
    ...large content
</div>
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文