Answer the question
In order to leave comments, you need to log in
How to use vuex getters in data?
I get data for charts from api, they are in the store, next:
computed: {
...mapGetters('budget', ['sessions', 'leads', 'sales', 'cps', 'cpl'])
},
datacollection: {
labels: this.dataset,
datasets: [
{
label: 'Sessions',
backgroundColor: 'rgba(85,203,242,0)',
borderColor: '#f2842f',
yAxisID: 'left',
data: this.session,
pointRadius: 4,
borderWidth: 2,
pointBackgroundColor: '#fff',
},
{
label: 'Sales',
backgroundColor: 'rgba(85,120,242,0)',
borderColor: '#ec5155',
yAxisID: 'left',
data: this.sales,
pointRadius: 4,
borderWidth: 2,
pointBackgroundColor: '#fff',
},
],
},
Answer the question
In order to leave comments, you need to log in
How to use vuex getters in data?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question