2.0.0 • Published 1 year ago
@aiao/lazy-component v2.0.0
@aiao/lazy-component
按需加载 任意 module
的 component
.
场景
弹框弹出任意组件, 在后台页面操作数据时使用非常频繁,可以隔离模块依赖
ivy 中使用
ivy
中也可以使用这种模式,弹框的内容会按 module
来分割代码延迟加载
需要继承 ICustomElementLazyComponent 接口,实现 customElementComponents 属性
import { LazyComponentModule, ICustomElementLazyComponent } from '@aiao/lazy-component';
import { NgModule, Type } from '@angular/core';
import { AloneDialogComponent } from './alone-dialog.component';
@NgModule({
declarations: [AloneDialogComponent],
imports: [LazyComponentModule]
})
export class AloneDialogModule implements ICustomElementLazyComponent {
customElementComponents: Type<any>[] = [AloneDialogComponent];
}
版本
lazy-module | angular |
---|---|
1.4 | 8.x - 15.x |
2.x | >= 16.x |
安装
yarn add @aiao/lazy-component
使用
2.0.0
1 year ago
1.7.2-alpha.0
2 years ago
1.7.2-alpha.1
2 years ago
1.7.2
2 years ago
1.7.0
3 years ago
1.6.0
3 years ago
1.5.1-alpha.0
4 years ago
1.5.0
4 years ago
1.4.0
4 years ago
1.3.0
4 years ago
1.2.0
4 years ago
1.1.0
4 years ago
1.0.0
4 years ago