시작하기
설치
⚠️ 최신 버전의 vue-pivottable은 Vue 3만 지원합니다. Vue 3을 사용 중이라면 vue3-pivottable 저장소를 참고하세요.
직접 다운로드 / 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
Vue 다음에 vue-pivottable을 포함하세요:
<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
사용 방법
컴포넌트를 import 하고 사용하세요.
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>