0.3.4 • Published 7 months ago

vue-slim-tables v0.3.4

Weekly downloads
4
License
MIT
Repository
github
Last release
7 months ago

Vue Slim Tables

Installation & basic usage

yarn add vue-slim-tables
// or
npm install vue-slim-tables
<template>
  <VueSlimTables :columns="columns" :source="asyncSource" />
</template>

<script setup>
const columns = [
  { key: 'id', title: 'ID' },
  { key: 'name', title: 'Name' },
  { key: 'phone', title: 'Phone' }
]

const asyncSource = (params) => {
  return fetch('...', params).then((res) => res.json())
}
</script>

Props

PropTypeRequiredDescription
columnsArraytrueArray of column objects described below
sourceFunctiontrueasync load
perPageNumberfalseNumber or rows to display. By default 25 will be used

Column object

KeyTypeRequiredDescription
keyStringtrueUniq key that used for ordering and slots
titleStringtrueDisplayed in thead cell
orderableBooleanfalseOrdering by column key

Slots

SlotPropsDescription
#thead:before-Add a row before main
#thead{ columns, orders }Rewrite the entire thead row
#thead:after-Add a row after main
#thead:${column.key}{ column }Rewrite thead cell with custom html
#row{ row, index, columns }Rewrite the entire tbody row
#row:empty-Rewrite empty table row markup
#row:loading-Rewrite loading table rows markup
#cell:${column.key}{ row, index, column, value }Rewrite tbody cell with custom html
#pagination{ page, rows }Rewrite pagination with your own implementation
0.3.4

7 months ago

0.3.2

2 years ago

0.3.0

2 years ago

0.3.1

2 years ago

0.1.2

2 years ago

0.1.1

3 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago