Closed Sumer6 closed 5 years ago
I added watch property in data. please update to v0.1.5
$ npm update vue-pivottable
Its works. Thank you very much.
@Sumer6 , Could you please, show how to use watch property. I also downloading data from API and would like to show pivot table when data is ready. Thank you very much!
Something like that:
<template lang="html">
<div v-if="!data.length">Loading...</div>
<vue-pivottable
:data="data"
:aggregatorName="aggregatorName"
:rendererName="rendererName"
:rows="rows"
:cols="cols"
:vals="vals"
:rowTotal="true"
:colTotal="true"
></vue-pivottable>
</template>
<script>
import axios from 'axios';
export default {
name: 'Example',
data: () => {
return {
data: [],
rendererName: 'Table',
aggregatorName: 'Sum',
rows: [],
cols: ['week'],
vals: ['time']
}
},
created() {
let self = this;
axios.get('/users')
.then(function(response) {
self.data = response;
});
}
}
</script>
@Sumer6 , Thanks!
How to display the table only after downloading a data?