vue-grid-layout
vue-grid-layout copied to clipboard
Autosize
Hey,
I have a loop, where I loop through the "layout" and inside that I loop through my widgets. When I use the this.$parent.autosize() function, then i'm getting this error:
TypeError: this.$slots.default[0].elm.getBoundingClientRect is not a function
and
Error in nextTick: "TypeError: this.$slots.default[0].elm.getBoundingClientRect is not a function"
It works on the first item that are in the widget loop
`<grid-layout
:layout="this.layout"
:col-num="2"
:row-height="30"
:is-draggable="true"
:is-resizable="false"
:vertical-compact="true"
:margin="[40, 35]"
:use-css-transforms="true"
:autoSize="true"
@layout-updated="layoutUpdatedEvent"
>
// griditem loop
<grid-item
v-for="(item, index) in layout"
:key="index"
:x="item.x"
:y="item.y"
:w="item.w"
:h="item.h"
:i="item.i"
drag-allow-from=".vue-draggable-handle"
drag-ignore-from=".no-drag"
>
// widgets loop
<div
v-for="(widget, i) in json"
:key="i"
v-if="item.i == widget.WidgetId"
:data="widget"
:is="widget.widgetName"
@remove-widget="removeWidget($event)"
>
</div>
</grid-item>
</grid-layout>`
Anyone that have en idea of what happens?
never had multiple items in one grid-item, what if you place the Widgets-loop into a separate template?
I also get the same mistake in this sandbox (click on minimize item 1) with nothing else than a string in gridItem. Did you ever find a solution ?
https://codesandbox.io/s/vue-grid-layout-minimized-item-thisslotsdefault0elmgetboundingclientrect-is-not-a-function-v3q6w
There has been a fix here #456 but why not merged ?