Skip to content

Commit

Permalink
perf: warap column generator in if
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-capsule42 committed Nov 1, 2024
1 parent dd9863b commit 0a017d1
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
16 changes: 9 additions & 7 deletions demo/api.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions demo/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions src/auro-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,18 @@ export class AuroTable extends LitElement {
* @returns { void }
*/
extractHeaders() {
const headerRow = this.shadowRoot.querySelector('thead tr');
if (this.columnHeaders) {
const headerRow = this.shadowRoot.querySelector('thead tr');

headerRow.innerHTML = '';
headerRow.innerHTML = '';

this.columnHeaders.forEach((header) => {
const th = document.createElement('th');
this.columnHeaders.forEach((header) => {
const th = document.createElement('th');

th.innerHTML = header;
headerRow.appendChild(th);
});
th.innerHTML = header;
headerRow.appendChild(th);
});
}
}

/**
Expand Down

0 comments on commit 0a017d1

Please sign in to comment.