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