Skip to content

Commit b5d61a9

Browse files
authored
feat(abc:st): add delay property (#1854)
1 parent 497166b commit b5d61a9

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

packages/abc/st/index.en-US.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ When an exception is thrown when parsing column data, *INVALID DATA* will be for
6666
| `[loading]` | Loading status of table, when specifying `null` is controlled by st | `boolean | null` | `null` | - |
6767
| `[loadingIndicator]` | The spinning indicator | `TemplateRef<void>` | - ||
6868
| `[loadingDelay]` | Specifies a delay in milliseconds for loading state (prevent flush) | `number` | `0` ||
69+
| [delay] | Whether to delay table rendering, requires manual call to refreshColumns() to render | boolean | false | - |
6970
| `[scroll]` | Whether table can be scrolled in x/y direction, x or y can be a string that indicates the width and height of table body | `{ y?: string; x?: string }` | - | - |
7071
| `[virtualScroll]` | Enable virtual scroll mode,work with `[nzScroll]` | `boolean` | `false` ||
7172
| `[virtualItemSize]` | The size of the items in the list, same as [cdk itemSize](https://material.angular.io/cdk/scrolling/api) | `number` | `54` ||

packages/abc/st/index.zh-CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ module: import { STModule } from '@delon/abc/st';
6666
| `[loading]` | 页面是否加载中,当指定 `null` 由 st 受控 | `boolean | null` | `null` | - |
6767
| `[loadingIndicator]` | 加载指示符 | `TemplateRef<void>` | - ||
6868
| `[loadingDelay]` | 延迟显示加载效果的时间(防止闪烁) | `number` | `0` ||
69+
| `[delay]` | 是否延迟渲染表格,需手动调用`refreshColumns()`渲染 | `boolean` | `false` | - |
6970
| `[scroll]` | 横向或纵向支持滚动,也可用于指定滚动区域的宽高度:`{ x: "300px", y: "300px" }` | `{ y?: string; x?: string }` | - | - |
7071
| `[virtualScroll]` | 是否启用虚拟滚动模式,与 `[nzScroll]` 配合使用 | `boolean` | `false` ||
7172
| `[virtualItemSize]` | 虚拟滚动时每一列的高度,与 [cdk itemSize](https://material.angular.io/cdk/scrolling/api) 相同 | `number` | `54` ||

packages/abc/st/st.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,7 @@ export class STComponent implements AfterViewInit, OnChanges {
322322
this.updateTotalTpl();
323323
}
324324
@Input() data?: string | STData[] | Observable<STData[]>;
325+
@Input() delay?: boolean = false;
325326
@Input() columns?: STColumn[] | null;
326327
@Input() contextmenu?: STContextmenuFn | null;
327328
@Input({ transform: (v: unknown) => numberAttribute(v, 10) }) ps = 10;
@@ -1073,7 +1074,7 @@ export class STComponent implements AfterViewInit, OnChanges {
10731074
}
10741075

10751076
ngAfterViewInit(): void {
1076-
this.refreshColumns();
1077+
if (!this.delay) this.refreshColumns();
10771078
if (!this.req.lazyLoad) this.loadPageData().subscribe();
10781079
this.inied = true;
10791080
}

0 commit comments

Comments
 (0)