I'm facing an issue where I am unable to reference the vue props within a callback in vue-chartjs. Whenever I try to access 'this', it gives me an 'undefined' error in the console log. Can someone please advise on the correct way to access the prop?
props: {
test: {
type: String,
required: true,
},
}
data: () => ({
chartOptions: {
tooltips: {
callbacks: {
label: function(tooltipItem, data) {
console.log(this.test);
return '';
}
}
}
}
});