Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

66
Vistas
How to use an external csv-file in a vue component using vue-papa-parse?

I'm a beginner working in view, being not so routined so far... For using an external csv-file in a vue component I am using parsepanda. I took this issue as my template, but I get an Error: TypeError: this.onComplete is not a function. Here is my code so far:

data() {
return {
    headData: {},
}
},

methods: { 
onComplete: function(csvData) {
this.headData = csvData
},
readFile: function() {
let url = "https://docs.google.com/spreadsheets/d/e/...&output=csv";
this.$papa.parse(url, {
    header: true,
    complete: function(results) {
          this.onComplete(results.data)
    }
});
}
},  


mounted() {
this.readFile()
console.log(this.headData)
}

I hope someone can help me... I'd like to use the csv-data as an array for my vue data. Thanks and kind regards, Corinna

7 months ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos