gwinnem/vue-responsive-grid-layout

Error basic Example

Closed this issue · 2 comments

afer install plugin in vue3 give this error:

Cannot read properties of undefined (reading 'length') vue-ts-responsive-grid-layout.es.js:4876
ReferenceError: Cannot access 'ot' before initialization vue-ts-responsive-grid-layout.es.js:4704

with this code:

const cols = ref({ lg: 12, md: 6, sm: 6, xs: 3, xxs: 3 });
const layout = ref([
{
i: 1,
x: 0,
y: 0,
w: 3,
h: 2,
text: "text 1",
},
{
i: 2,
x: 3,
y: 0,
w: 3,
h: 2,
text: "text 2",
},
{
i: 3,
x: 6,
y: 0,
w: 3,
h: 2,
text: "text 3",
},
]);

<GridLayout
v-model:layout="layout"
:is-resizable="true"
:is-draggable="true"
:auto-size="true"
:cols="cols"

<GridItem
  v-for="item in layout"
  :key="item.i"
  :is-resizable="true"
  :responsive="true"
  :enable-edit-mode="true"
  :x="item.x"
  :y="item.y"
  :w="item.w"
  :h="item.h"
  :i="item.i"
>
  <div class="blockCss">{{ item.text }}</div>
</GridItem>

https://codesandbox.io/s/thirsty-paper-78jdgd?file=/src/GridTest.vue

I checked your code and it seems to be working well.
can you provide some detail about your code, and the version of the lib you are using?

this codesanbox example is vue 3.3.4, vue-responsive-grid-layout version is 1.1.1.

in my own project, it works well too. it's vue 3.2.47, vue-responsive-grid-layout version is 1.2.2.

@UTing1119 Tnxs for the sandbox example.

@jplajpla23
Try to upgrade to the latest version.