I'm currently using the VueJsonCSV component to export data to a CSV file. The values being exported are retrieved from the Vuex Store.
<template>
<v-btn depressed> <download-csv :data="json_data"> Export Files </download-csv> </v-btn>
</template>
<script>
export default {
data() {
return {
json_data: [
{
No: '1',
Parameters: 'Scenario Name',
Values: `${this.$store.state.scenario.scenario}`,
},
{
No: '2',
Parameters: 'Terrain Name',
Values: `${this.$store.state.scenario.environment.ground}`,
},
{
No: '3',
Parameters: 'Frequency',
Values: `${this.$store.state.scenario.environment['antennas-db'].frequency}`,
},
{
No: '4',
Parameters: 'Environment_type',
Values: `${this.$store.state.scenario.environment.network['ground-profile']}`,
},
{
No: '5',
Parameters: 'Downlink_scheduler_type',
Values: `${this.$store.state.scenario.environment['antennas-db'].scheduler}`,
},
],
}
},
}
</script>
After updating these values in the Vuex store, I noticed that the data in json_data does not automatically update and reflect the changes when exporting to csv. Instead, it still exports the old data. Can anyone familiar with VueJS suggest which function should be used in the script to ensure that the json_data is always updated with the latest data from the Vuex store before exporting? Your assistance is greatly appreciated!