vue-grid-layout icon indicating copy to clipboard operation
vue-grid-layout copied to clipboard

Autosize

Open thomashdk opened this issue 6 years ago • 3 comments

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?

thomashdk avatar Oct 17 '18 13:10 thomashdk

never had multiple items in one grid-item, what if you place the Widgets-loop into a separate template?

mech01nc01 avatar Oct 29 '18 14:10 mech01nc01

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

thibaut-lo avatar Jul 03 '20 09:07 thibaut-lo

There has been a fix here #456 but why not merged ?

MarineLB avatar Mar 10 '21 12:03 MarineLB