`simplebar` 不起作用,如何与 angular 集成
`simplebar` not works, how to integrate with angular
我的appcomponent.ts:
import { Component } from '@angular/core';
import 'simplebar';
import 'simplebar/dist/simplebar.css';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
export class AppComponent {
name = 'Angular';
}
html:
<div class="container" data-simplebar id="content">
<div class="big-width">
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Accusamus nobis similique, temporibus eaque eum vel adipisci sed harum obcaecati animi praesentium consequatur sint consectetur iure accusantium explicabo voluptate perspiciatis nemo.
</div>
</div>
希望整合纵向和横向但行不通。还应该补充什么?
有人帮帮我吗?
1) 首先安装npm install simplebar --save
2) 在 polyfills.ts 中添加:import 'simplebar;
3) 然后在主 style.scss 文件中添加:@import '~simplebar/dist/simplebar.css';
4) 将 data-simplebar 属性添加到要使用此主题滚动的元素。
我的appcomponent.ts:
import { Component } from '@angular/core';
import 'simplebar';
import 'simplebar/dist/simplebar.css';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
styleUrls: [ './app.component.css' ]
})
export class AppComponent {
name = 'Angular';
}
html:
<div class="container" data-simplebar id="content">
<div class="big-width">
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Accusamus nobis similique, temporibus eaque eum vel adipisci sed harum obcaecati animi praesentium consequatur sint consectetur iure accusantium explicabo voluptate perspiciatis nemo.
</div>
</div>
希望整合纵向和横向但行不通。还应该补充什么?
有人帮帮我吗?
1) 首先安装npm install simplebar --save
2) 在 polyfills.ts 中添加:import 'simplebar;
3) 然后在主 style.scss 文件中添加:@import '~simplebar/dist/simplebar.css';
4) 将 data-simplebar 属性添加到要使用此主题滚动的元素。