Examples
Output
Tomato | Orange | Cucumber | Grapes | Mango |
---|---|---|---|---|
Sales | Sales | Sales | Sales | Sales |
30 | 20 | 12 | 120 | 180 |
1–1 of 1 1 of 1
Input
vue
<template>
<PivotDataTable
:items
:measures
:pivot
/>
</template>
<script setup>
import type { Pivot, Measure, Item } from "vue3-pivot-data-table";
const pivot: Pivot = { text: 'Fruit', value: 'fruit' };
const measures: Measure[] = [{ text: 'Sales', value: 'sales', sortable: true}];
const items: Item[] = [
{ fruit: 'Tomato', sales: 30 },
{ fruit: 'Orange', sales: 20 },
{ fruit: 'Cucumber', sales: 12 },
{ fruit: 'Grapes', sales: 120 },
{ fruit: 'Mango', sales: 180 },
];
</script>