如何隐藏 ngb-carousel 指示器和 prev-next 控件
how to hide ngb-carousel indicators and prev-next control
我无法通过 css 隐藏 ngb-carousel 指示器和 prev-next 控件,
以 css class 为目标是行不通的。
有没有隐藏的选项?
为了影响 ng-bootstrap 组件的 css,您必须禁用 ViewEncapsulation。
从@angular/core导入:
import { ViewEncapsulation } from '@angular/core'
然后在@Component 声明中为此组件禁用它:
@Component({
encapsulation: ViewEncapsulation.None,
selector: 'your-template-name',
styleUrls: ['your-template-name.component.scss'],
template: `
... `
})
然后您可以在 css 文件中定位 Bootstrap 类 等。
您想在每个组件的基础上禁用此功能,并且仅在需要时才禁用。
我无法通过 css 隐藏 ngb-carousel 指示器和 prev-next 控件, 以 css class 为目标是行不通的。 有没有隐藏的选项?
为了影响 ng-bootstrap 组件的 css,您必须禁用 ViewEncapsulation。
从@angular/core导入:
import { ViewEncapsulation } from '@angular/core'
然后在@Component 声明中为此组件禁用它:
@Component({
encapsulation: ViewEncapsulation.None,
selector: 'your-template-name',
styleUrls: ['your-template-name.component.scss'],
template: `
... `
})
然后您可以在 css 文件中定位 Bootstrap 类 等。
您想在每个组件的基础上禁用此功能,并且仅在需要时才禁用。