svelte-grid icon indicating copy to clipboard operation
svelte-grid copied to clipboard

Uncaught TypeError: columns.slice is not a function

Open m93a opened this issue 2 years ago • 1 comments

If I try the basic example from Usage, I get a type error:

<script>
import Grid from "svelte-grid";
import gridHelp from "svelte-grid/build/helper/index.mjs";

const id = () => "_" + Math.random().toString(36).substr(2, 9);

let items = [
  gridHelp.item({ x: 0, y: 0, w: 2, h: 2, id: id() }),
  gridHelp.item({ x: 2, y: 0, w: 2, h: 2, id: id() }),
];
</script>
<Grid cols={3} bind:items={items} let:item={item}>
  <div>{item.id}</div>
</Grid>
Uncaught TypeError: columns.slice is not a function
    at getColumn (other.js:23:31)
    at index.svelte? [sm]:103:27

Link to Svelte REPL.

m93a avatar May 11 '22 11:05 m93a

Uhh.... looks like the original API has changed to a much more cumbersome one and no one updated the docs... What version do I need to get the old API back?

m93a avatar May 11 '22 12:05 m93a