I'm using vue-json-excel
to export an Excel spreadsheet (I have the table on my screen and use it to export the same data to excel).
So far, everything works perfectly, however, I had problems with accentuations. Example, não
, appears Não
, and so on.
<download-excel
class = "btn btn-default"
:data = "data.resultado"
:fields = "json_fields"
:meta = "json_meta"
name = "filename.xls" style="margin-bottom: 10px;">
</download-excel>
JS
data(){
return{
data: {},
filterTerm: '',
json_fields : {},
json_data: [],
json_meta: [
[{
"key": "charset",
"value": "utf8"
}]
]
}
},
Data is coming from the database, and the screen is displayed correctly.
In this way, I do to insert the data of my bank into a objeto
for(let i = 0; i < this.data.titulos.length; i++){
this.json_fields[this.data.titulos[i]] = "String"
}
JSON RETURN
{
"titulos":[
"Data Emissão",
"Data Saída",
"CAMPO 3",
"CAMPO 4"
],
"resultado":[
[
"Carta Correção",
"Não",
"Não ",
"09/08/2017 17:56"
],
[
"Solicita Alteração",
"Não",
"Não ",
"09/08/2017 17:56"
],
[
"UM",
464752,
"UM ",
"09/08/2017 17:56"
],
[
"UM",
464752,
"UM ",
"09/08/2017 17:56"
]
]
}