groupBy count in lodash

data(){
productValue:[
   {
  localData: '8/13/2017'
   },
   {
  localData: '8/13/2017'
   },
   {
  localData: '6/13/2017'
   },
   {
  localData: '5/13/2017'
   }
 ]
},
computed:{
 productVal(){
 var vm = this
  return  _.countBy(vm.productValue, function(o){
   return moment(o.localData).format('MM');
  }); 
 },
 
  },
//{ "08": 2, "06": 1, "05": 1 }

No comments:

The Weekender: Moon metaphors, procrastinating monks, and a visit to a cheese factory

What we’re reading, watching, and listening to this week ͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ...

Contact Form

Name

Email *

Message *