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 6 New Rules of Communicating

The era of teleprompters and talking points has come to an end ͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­͏     ­...

Contact Form

Name

Email *

Message *