You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As it was, if one was to investigate the size of GridItems in an
@layout-ready event handler, the size was not yet correct.
The problem was that layout-ready was emitted in mounted() after a
call to onWindowResize(). onWindowResize() set the width with
this.width = this.$refs.item.offsetWidth
but the width (and hence size generally) change only actually took
effect in the watcher for 'width' with:
this.eventBus.$emit("updateWidth", this.width);
and in addition, that was done inside a this.$nextTick() for some
undocumented reason.
Now, the layout-ready event is emitted after "updateWidth" has been
emitted, so callers can investigate GridItem sizes safely.
Care is taken in the width watcher to only emit layout-ready the first
time width is set, and layout-ready is emitted in a this.$nextTick()
so that the 'updateWidth' has a chance to take effect in the child
GridItems before layout-ready is emitted. See comment in
GridLayout.vue for more details.
0 commit comments