We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
module
import { ScrollDispatchModule } from '@angular/cdk/scrolling'; @NgModule({ imports: [ ScrollDispatchModule, ], })
component.ts
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; @Component({ selector: 'vir-ckd-demo', templateUrl: './ckd-demo.component.html', styleUrls: ['./ckd-demo.component.scss'], changeDetection: ChangeDetectionStrategy.OnPush, }) export class CkdDemoComponent implements OnInit { items = Array.from({ length: 100000 }).map((_, i) => `第${i}个`); constructor() {} ngOnInit() {} }
component.html
<cdk-virtual-scroll-viewport itemSize="10" class="example-viewport"> <div *cdkVirtualFor="let item of items" class="example-item">{{ item }}</div> </cdk-virtual-scroll-viewport>
==itemSize==注意它的作用
component.css
.example-viewport { height: 200px; width: 200px; border: 1px solid black; } .example-item { height: 50px; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Angular cdk 虚拟滚动例子
==itemSize==注意它的作用
The text was updated successfully, but these errors were encountered: