How to ad export csv, excel button on vuetify data table?
Asked Answered
D

1

6

I am new for vuetify and faced problem with exporting my v-data-table to excel, csv format. How can i do it. Any suggestion or reccomondation. Thank you so much.

Deal answered 21/8, 2020 at 10:52 Comment(0)
P
8

You can use vue-json-to-csv to export the table data to a csv file:

<vue-json-to-csv
     :json-data="yourList"
     :csv-title="'fileName'"
>
     <v-btn color="success" class="mr-6">
          Export <i class="mdi mdi-export-variant" aria-hidden="true"></i>
     </v-btn>
</vue-json-to-csv>

Make sure to pass yourList as the data and fileName as the desired outputted file name.

Here is the link for more details: https://www.npmjs.com/package/vue-json-to-csv

Prearrange answered 21/8, 2020 at 10:58 Comment(1)
Note: vue-json-to-csv hasn't published in 5 years and is currently only available for Vue.js 2. Try vue-json-csv instead.Diplex

© 2022 - 2024 — McMap. All rights reserved.