After initializing the data, I have an object structured like this and I am able to push data using the method below:
myObj = {
1: ["a", "b", "c"],
2: ["c", "d", "e"],
}
data: {
types: {}
},
methods: {
pushValue(key, value) {
var obj = this.types
if (obj.hasOwnProperty(key)) {
var idx = $.inArray(value, obj[key]);
if (idx == -1) {
obj[key].push([value]);
}
} else {
this.$set(obj, key, [value]);
}
},
}
This current structure functions properly.
However, now I aim for my object to be in this format:
myObj = {
1: {
"a": [
[],[]
],
"b": [
[],[]
],
}
}
I need guidance on how to modify my append function to achieve this new structure.