After creating a map of maps structured like this:
{year1:{topic1:[article1,article2]},year2:{topic1:{article3}}}
I attempted to use v-for for iterating through this map but encountered difficulties.
Upon printing the template, I noticed the output looked like this:
{ "Map(1)": { "2016 =>": { "Map(2)": { "Conference =>": [1], "Journal =>": [ 2, 3 ] } } } }
The code snippet used for generating this map is as follows:
var result = new Map()
for (var t in temparray){
var object = this.papers[temparray[t]]
var year = object.year
var tt = object.type
if (result.get(year) ==undefined){
var a = new Map()
a.set(tt,[temparray[t]])
result.set(year, a)
}
else{
var inner = result.get(year)
if (!inner.has(tt)){
inner.set(tt,[temparray[t]])
}
else{
inner.get(tt).push(temparray[t])
}
}
}
this.selectedPapers = result
The expected outcome for the map should resemble something similar to this:
{"2016":{"Conference":[1]}}