Skip to content

Commit

Permalink
perf(grid): improve grid performance
Browse files Browse the repository at this point in the history
  • Loading branch information
janryWang committed Oct 19, 2021
1 parent 8154c20 commit 7c60bc1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/grid/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export class Grid<Container extends HTMLElement> {
height: observable.ref,
childCount: observable.ref,
childSpans: observable.ref,
columns: observable.computed,
templateColumns: observable.computed,
gap: observable.computed,
})
Expand Down Expand Up @@ -178,6 +179,7 @@ export class Grid<Container extends HTMLElement> {
}

get templateColumns() {
if (!this.width) return ''
if (this.maxWidth === Infinity) {
return `repeat(${this.columns},1fr)`
}
Expand Down

0 comments on commit 7c60bc1

Please sign in to comment.