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

Documentation incomplete on `cols` prop

Open clozach opened this issue 4 years ago • 2 comments

Quick aside: cool library! Thanks for sharing it. :)

The Usage docs claim that the cols prop should be a number representing the number of columns in the layout, but that doesn't seem to be the whole story. Many of the examples actually pass in a matrix, like in the Basic example:

const cols = [
  [ 1200, 6 ],
];

It would be helpful (and complete) to include an explanation of this matrix variant, especially as it relates to the hard-coded numerical item keys in those same examples, e.g.:

let items = [
  {
    6: gridHelp.item({ 
  //↑ This seems somehow related to the `6` in
  //  the previous `[1200, 6]`, right?

clozach avatar Feb 15 '21 09:02 clozach

yes cols must be Array<Array<Number>>

you basically tell the grid to have 6 columns, when the width of the container is >= N (1200)

vaheqelyan avatar Feb 24 '21 19:02 vaheqelyan

then please fix the docs, this is so confusing my guy

jkukatzki avatar Oct 27 '22 14:10 jkukatzki