Getting Started
Installation
⚠️ Latest version of vue-pivottable supports Vue 3 only. If you're using Vue 3, please refer to the vue3-pivottable repository.
Direct Download / CDN
- unpkg: https://unpkg.com/vue-pivottable@0.4.68/dist/vue-pivottable.umd.min.js
- jsdelivr: https://cdn.jsdelivr.net/npm/vue-pivottable@0.4.68/dist/vue-pivottable.umd.min.js
Include vue-pivottable after Vue:
<script src="/path/to/vue.js"></script>
<script src="/path/to/vue-pivottable.umd.min.js"></script>
NPM
# install in your project
npm install vue-pivottable@0.4.68
Usage
Import and use a component.
Vue Pivottable
<template>
<vue-pivottable
:data="[{color: 'blue', shape: 'circle'},{color: 'red', shape: 'triangle'}]"
:rows="['color']"
:cols="['shape']"
>
</vue-pivottable>
</template>
<script>
import { VuePivottable } from 'vue-pivottable'
import 'vue-pivottable/dist/vue-pivottable.css'
export default {
components: {
VuePivottable
}
}
</script>
Vue Pivottable UI
<template>
<vue-pivottable-ui
:data="[{color: 'blue', shape: 'circle'},{color: 'red', shape: 'triangle'}]"
:rows="['color']"
:cols="['shape']"
>
</vue-pivottable-ui>
</template>
<script>
import { VuePivottableUi } from 'vue-pivottable'
import 'vue-pivottable/dist/vue-pivottable.css'
export default {
components: {
VuePivottableUi
}
}
</script>