Angular 5+的自定义叠加滚动条– ngx-scrollbar

Angular 5+的自定义叠加滚动条– ngx-scrollbar
插件名称 ngx-scrollbar
发布时间 2020年7月23日
插件作者 MurhafSousli

ngx-scrollbar为Angular 5+应用程序提供了具有本机滚动机制的自定义覆盖滚动条。

安装:

# Yarn
$ yarn add ngx-scrollbar

# NPM
$ npm install ngx-scrollbar --save

用法:

将ngx-scrollbar导入模块。

import { ScrollbarModule } from 'ngx-scrollbar';

标记。

<ng-scrollbar class="sample">
  <div class="inner">
    <b>Lorem ipsum dolor sit amet</b>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet mollitia vero quam, nisi possimus dolorem
      asperiores, molestiae sit voluptatibus alias consequuntur laudantium repellat ea quidem quaerat rerum
      perspiciatis iste adipisci.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Assumenda earum facilis sed nihil numquam at
      accusamus eum error eaque alias hic sint rem consequatur impedit tempore, dolor, quos, quae esse?</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Labore maiores maxime corrupti quisquam.
      Dignissimos sunt error voluptatibus repellat consequatur illo, aliquid nihil maxime veniam repudiandae,
      provident et sit, reiciendis dicta.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Repudiandae id amet deserunt voluptate maiores
      sunt
      aut eligendi totam nesciunt magnam illo consectetur aspernatur at voluptatem, qui unde ullam omnis
      voluptates.</p>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Id assumenda et fugiat placeat enim quas,
      voluptas
      odio aperiam in quibusdam beatae eaque minima. Consequuntur pariatur, doloremque, odit dolorem ullam
      sunt!</p>
  </div>
</ng-scrollbar>