Reputation: 55
I am trying to pass the grid array to the createGridChart
, however, this is giving me an error:
“grid is not defined”.
export default {
data() {
return {
grid: [],
}
},
mounted() {
this.createGrid();
this.createGridChart('grid-chart', 'pie', grid);
(...)
What would be the correct way to the the grid inside the function so that I can manipulate it to my liking?
Upvotes: 2
Views: 2444
Reputation: 24156
You need to change grid
to this.grid
.
export default {
data() {
return {
grid: [],
}
},
mounted() {
this.createGrid();
this.createGridChart('grid-chart', 'pie', this.grid);
(...)
Upvotes: 3