1๐
โ
Use options instead:
name: 'myComponent',
data: () {
return {
some: 'properties'
}
},
nonReactiveData: {
whatever: 'you like'
}
This basically creates your component with an option
named nonReactiveData
. Then you could use it in your html like:
<some-component :data="$options.nonReactiveData">
Or if you need it in your script:
methods: {
someMethod() {
console.log(this.$options.nonReactiveData)
}
}
Hope that helps ๐
0๐
Fixed it by concatenating the dynamicDataCollection Object:
that.dynamicDataCollection = [];
for (i =0; i < allDeptNames.length; i++) {
let datasets = [
{
label: allDeptNames[i],
backgroundColor: barColours[i],
data: [spaceIterationIns[i].length]
}
]
that.dynamicDataCollection.push(datasets);
}
// here
let dynamicFlat = [].concat.apply([], that.dynamicDataCollection)
that.datacollection2 = {
labels: ['Weekly'],
datasets: [
]
}
// and then here
that.datacollection2.datasets = dynamicFlat;
Source:stackexchange.com