Skip to content

Commit

Permalink
fix: correctly emit layout-ready event (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
kingyue737 committed Apr 22, 2024
1 parent f4db9b3 commit 703b3be
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/grid-layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,9 @@ watch(
(newVal, oldVal) => {
nextTick(() => {
emitter.emit('updateWidth', newVal)
if (oldVal === null) {
if (oldVal === -1) {
/*
If oldVal == null is when the width has never been
If oldVal === -1 is when the width has never been
set before. That only occurs when mounting is
finished, and onWindowResize has been called and
this.width has been changed the first time after it
Expand Down

0 comments on commit 703b3be

Please sign in to comment.