web: add TablePage
This commit is contained in:
@ -6,7 +6,7 @@ import { COMMON_STYLES } from "../../common/styles";
|
||||
export abstract class Table<T> extends LitElement {
|
||||
abstract apiEndpoint(page: number): Promise<PBResponse<T>>;
|
||||
abstract columns(): Array<string>;
|
||||
abstract row(item: any): Array<string>;
|
||||
abstract row(item: T): Array<string>;
|
||||
|
||||
@property()
|
||||
data?: PBResponse<T>;
|
||||
@ -61,7 +61,7 @@ export abstract class Table<T> extends LitElement {
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
renderTable() {
|
||||
if (!this.data) {
|
||||
this.fetch();
|
||||
}
|
||||
@ -103,4 +103,8 @@ export abstract class Table<T> extends LitElement {
|
||||
></pb-table-pagination>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
render() {
|
||||
return this.renderTable();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user