I have an object that retrieves 4 different elements with different numerical values.
I'm trying to access and retrieve all these numerical values.
The object returns the following:
{__ob__: Observer}
collectedTrashCount: 139
dangerousAreaCount: 11
schoolCount: 5
trashBinCount: 44
If I want to retrieve the value of the collectedTrashCount
, I would simply do the following:
computed: {
dashboardList: function () {
return this.$store.getters.getDashboard;
},
checkCount: function () {
console.log(this.dashboardList.collectedTrashCount);
}
},
The console.log
in this case would give me 139
.
My question is: What should I do to return all these values such as: 139
, 11
, 5
, 44
?
question from:
https://stackoverflow.com/questions/65843919/javascript-vue-js-retrieve-value-of-all-elements-in-object 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…